RPi Pico screen, CannedMessageModule (CardKB) and reboot support (#2595)

* Make input_source case insensitive

* Implement reboot for RP2040

* Remove EXT_NOTFIFY_OUT as it conflicts with I2C and module is not supported

* RP2040 has screen, button and wire

* Add default I2C pins also for Pico W
This commit is contained in:
GUVWAF 2023-07-08 18:32:36 +02:00 committed by GitHub
parent 97606cd382
commit d8ad2b3f48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 9 deletions

View File

@ -123,8 +123,8 @@ int CannedMessageModule::splitConfiguredMessages()
int CannedMessageModule::handleInputEvent(const InputEvent *event)
{
if ((strlen(moduleConfig.canned_message.allow_input_source) > 0) &&
(strcmp(moduleConfig.canned_message.allow_input_source, event->source) != 0) &&
(strcmp(moduleConfig.canned_message.allow_input_source, "_any") != 0)) {
(strcasecmp(moduleConfig.canned_message.allow_input_source, event->source) != 0) &&
(strcasecmp(moduleConfig.canned_message.allow_input_source, "_any") != 0)) {
// Event source is not accepted.
// Event only accepted if source matches the configured one, or
// the configured one is "_any" (or if there is no configured

View File

@ -2,9 +2,18 @@
#define ARCH_RP2040
#ifndef HAS_BUTTON
#define HAS_BUTTON 1
#endif
#ifndef HAS_TELEMETRY
#define HAS_TELEMETRY 1
#endif
#ifndef HAS_SCREEN
#define HAS_SCREEN 1
#endif
#ifndef HAS_WIRE
#define HAS_WIRE 1
#endif
#ifndef HAS_SENSOR
#define HAS_SENSOR 1
#endif

View File

@ -12,6 +12,8 @@ void powerCommandsCheck()
ESP.restart();
#elif defined(ARCH_NRF52)
NVIC_SystemReset();
#elif defined(ARCH_RP2040)
rp2040.reboot();
#else
rebootAtMsec = -1;
LOG_WARN("FIXME implement reboot for this platform. Skipping for now.\n");
@ -33,4 +35,4 @@ void powerCommandsCheck()
LOG_WARN("FIXME implement shutdown for this platform");
#endif
}
}
}

View File

@ -15,11 +15,11 @@
#define USE_SH1106 1
#undef GPS_SERIAL_NUM
// #define I2C_SDA 6
// #define I2C_SCL 7
// default I2C pins:
// SDA = 4
// SCL = 5
#define BUTTON_PIN 17
#define EXT_NOTIFY_OUT 4
#define LED_PIN PIN_LED

View File

@ -15,11 +15,11 @@
#define USE_SH1106 1
#undef GPS_SERIAL_NUM
// #define I2C_SDA 6
// #define I2C_SCL 7
// default I2C pins:
// SDA = 4
// SCL = 5
#define BUTTON_PIN 17
#define EXT_NOTIFY_OUT 4
#define BATTERY_PIN 26
// ratio of voltage divider = 3.0 (R17=200k, R18=100k)