Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use M5STACK_COREBASIC instead for M5STACK to avoid confusion #5008

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/graphics/Screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1606,7 +1606,7 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver)
#endif

#if defined(ST7789_CS) && \
!defined(M5STACK) // set display brightness when turning on screens. Just moved function from TFTDisplay to here.
!defined(M5STACK_COREBASIC) // set display brightness when turning on screens. Just moved function from TFTDisplay to here.
static_cast<TFTDisplay *>(dispdev)->setDisplayBrightness(brightness);
#endif

Expand Down Expand Up @@ -2817,4 +2817,4 @@ int Screen::handleAdminMessage(const meshtastic_AdminMessage *arg)
} // namespace graphics
#else
graphics::Screen::Screen(ScanI2C::DeviceAddress, meshtastic_Config_DisplayConfig_OledType, OLEDDISPLAY_GEOMETRY) {}
#endif // HAS_SCREEN
#endif // HAS_SCREEN
14 changes: 7 additions & 7 deletions src/graphics/TFTDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ void TFTDisplay::sendCommand(uint8_t com)
display(true);
if (settingsMap[displayBacklight] > 0)
digitalWrite(settingsMap[displayBacklight], TFT_BACKLIGHT_ON);
#elif !defined(RAK14014) && !defined(M5STACK) && !defined(UNPHONE)
#elif !defined(RAK14014) && !defined(M5STACK_COREBASIC) && !defined(UNPHONE)
tft->wakeup();
tft->powerSaveOff();
#endif
Expand All @@ -730,7 +730,7 @@ void TFTDisplay::sendCommand(uint8_t com)
unphone.backlight(true); // using unPhone library
#endif
#ifdef RAK14014
#elif !defined(M5STACK) && !defined(ST7789_CS) // T-Deck gets brightness set in Screen.cpp in the handleSetOn function
#elif !defined(M5STACK_COREBASIC) && !defined(ST7789_CS) // T-Deck gets brightness set in Screen.cpp in the handleSetOn function
tft->setBrightness(172);
#endif
break;
Expand All @@ -742,7 +742,7 @@ void TFTDisplay::sendCommand(uint8_t com)
tft->clear();
if (settingsMap[displayBacklight] > 0)
digitalWrite(settingsMap[displayBacklight], !TFT_BACKLIGHT_ON);
#elif !defined(RAK14014) && !defined(M5STACK) && !defined(UNPHONE)
#elif !defined(RAK14014) && !defined(M5STACK_COREBASIC) && !defined(UNPHONE)
tft->sleep();
tft->powerSaveOn();
#endif
Expand All @@ -754,7 +754,7 @@ void TFTDisplay::sendCommand(uint8_t com)
unphone.backlight(false); // using unPhone library
#endif
#ifdef RAK14014
#elif !defined(M5STACK)
#elif !defined(M5STACK_COREBASIC)
tft->setBrightness(0);
#endif
break;
Expand Down Expand Up @@ -788,7 +788,7 @@ bool TFTDisplay::hasTouch(void)
{
#ifdef RAK14014
return true;
#elif !defined(M5STACK)
#elif !defined(M5STACK_COREBASIC)
return tft->touch() != nullptr;
#else
return false;
Expand All @@ -807,7 +807,7 @@ bool TFTDisplay::getTouch(int16_t *x, int16_t *y)
} else {
return false;
}
#elif !defined(M5STACK)
#elif !defined(M5STACK_COREBASIC)
return tft->getTouch(x, y);
#else
return false;
Expand Down Expand Up @@ -839,7 +839,7 @@ bool TFTDisplay::connect()

tft->init();

#if defined(M5STACK)
#if defined(M5STACK_COREBASIC)
tft->setRotation(0);
#elif defined(RAK14014)
tft->setRotation(1);
Expand Down
4 changes: 2 additions & 2 deletions src/platform/esp32/architecture.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@
#define HW_VENDOR meshtastic_HardwareModel_PRIVATE_HW
#elif defined(NANO_G1)
#define HW_VENDOR meshtastic_HardwareModel_NANO_G1
#elif defined(M5STACK)
#define HW_VENDOR meshtastic_HardwareModel_M5STACK
#elif defined(M5STACK_COREBASIC)
#define HW_VENDOR meshtastic_HardwareModel_M5STACK_COREBASIC
#elif defined(STATION_G1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This, on the other hand, needs a change to the protobufs :-) meshtastic_HardwareModel_M5STACK_CORE is not defined there, meshtastic_HardwareModel_M5STACK is. Since it's not used anywhere else, you can leave the old value

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is the protobufs PR: meshtastic/protobufs#598

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is why M5STACK_COREBASIC has been defined is protobufs. So we can use M5STACK_COREBASIC instead for M5STACK which is a brand and not a model to avoid confusion.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave the hardware enum as it is, it's not showing up anywhere in writing. more like a macro for code...

#define HW_VENDOR meshtastic_HardwareModel_STATION_G1
#elif defined(DR_DEV)
Expand Down
4 changes: 2 additions & 2 deletions variants/m5stack_core/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build_src_filter =
build_flags =
${esp32_base.build_flags} -I variants/m5stack_core
-DILI9341_DRIVER
-DM5STACK
-DM5STACK_COREBASIC
-DUSER_SETUP_LOADED
lboue marked this conversation as resolved.
Show resolved Hide resolved
-DTFT_SDA_READ
-DTFT_DRIVER=0x9341
Expand All @@ -25,4 +25,4 @@ lib_ignore =
m5stack-core
lib_deps =
${esp32_base.lib_deps}
lovyan03/LovyanGFX@^1.1.8
lovyan03/LovyanGFX@^1.1.8