You've already forked uiflow-micropython
mirror of
https://github.com/m5stack/uiflow-micropython.git
synced 2026-05-20 10:39:27 -07:00
64e88617d2
Signed-off-by: luoweiyuan <luoweiyuan@m5stack.com>
48 lines
1.7 KiB
Diff
48 lines
1.7 KiB
Diff
Index: M5Unified/src/M5Unified.cpp
|
|
===================================================================
|
|
--- M5Unified.orig/src/M5Unified.cpp
|
|
+++ M5Unified/src/M5Unified.cpp
|
|
@@ -1050,7 +1050,15 @@ static constexpr const uint8_t _pin_tabl
|
|
default:
|
|
case 0: // EFUSE_PKG_VERSION_ESP32S3: // QFN56
|
|
if (board == board_t::board_unknown)
|
|
- { /// StampS3 or AtomS3Lite,S3U ?
|
|
+ {
|
|
+ #if defined (BOARD_ID) && BOARD_ID == 147
|
|
+ board = board_t::board_M5DualKey;
|
|
+ // !!!NOTE: Set to input mode to prevent the device from failing to shut down.
|
|
+ m5gfx::pinMode(GPIO_NUM_7, m5gfx::pin_mode_t::input);
|
|
+ m5gfx::pinMode(GPIO_NUM_8, m5gfx::pin_mode_t::input);
|
|
+ break;
|
|
+ #endif
|
|
+ /// StampS3 or AtomS3Lite,S3U ?
|
|
/// After setting GPIO38 to INPUT PULL-UP, change to INPUT and read it.
|
|
/// In the case of STAMPS3: Returns 0. Charge is sucked by SGM2578.
|
|
/// In the case of ATOMS3Lite/S3U : Returns 1. Charge remains. ( Since it is not connected to anywhere. )
|
|
@@ -1661,6 +1669,10 @@ static constexpr const uint8_t _pin_tabl
|
|
m5gfx::pinMode(GPIO_NUM_11, m5gfx::pin_mode_t::input);
|
|
break;
|
|
|
|
+ case board_t::board_M5DualKey:
|
|
+ m5gfx::pinMode(GPIO_NUM_0, m5gfx::pin_mode_t::input);
|
|
+ m5gfx::pinMode(GPIO_NUM_17, m5gfx::pin_mode_t::input);
|
|
+ break;
|
|
#endif
|
|
|
|
default:
|
|
@@ -2444,6 +2456,14 @@ static constexpr const uint8_t _pin_tabl
|
|
;
|
|
break;
|
|
}
|
|
+
|
|
+ case board_t::board_M5DualKey:
|
|
+ {
|
|
+ use_rawstate_bits = 0b00011;
|
|
+ btn_rawstate_bits = ((!m5gfx::gpio_in(GPIO_NUM_0)) & 1)
|
|
+ | ((!m5gfx::gpio_in(GPIO_NUM_17)) & 1) << 1;
|
|
+ break;
|
|
+ }
|
|
default:
|
|
|
|
break;
|