Add get leds and set leds on|off for Companion, repeater, room server and sensor builds. Preserve the setting across reboots and cover GPIO, RGB, Bluetooth, notification and expander indicators without changing radio amplifier controls or screen backlights. RAK Companions blink while advertising and keep the Bluetooth LED off once connected, including late timer callbacks. Adapted from meshcore-dev/MeshCore#3605 and #2694. Validated with host regressions and firmware builds for SenseCAP Solar, RAK4631, T096, Heltec V4, T-Beam, Xiao S3, Pico W and Wio E5 Mini. Co-authored-by: R0ck <develop@hectospark.co.uk> Co-authored-by: Nick Dunklee <nick@dunklee.org>
32 lines
606 B
C++
32 lines
606 B
C++
#ifdef WIO_WM1110
|
|
|
|
#include "WioWM1110Board.h"
|
|
|
|
#include <Arduino.h>
|
|
#include <Wire.h>
|
|
|
|
void WioWM1110Board::begin() {
|
|
NRF52BoardDCDC::begin();
|
|
|
|
pinMode(BATTERY_PIN, INPUT);
|
|
pinMode(LED_GREEN, OUTPUT);
|
|
pinMode(LED_RED, OUTPUT);
|
|
pinMode(SENSOR_POWER_PIN, OUTPUT);
|
|
|
|
digitalWrite(LED_GREEN, mesh::leds::enabled() ? HIGH : LOW);
|
|
digitalWrite(LED_RED, LOW);
|
|
digitalWrite(SENSOR_POWER_PIN, LOW);
|
|
|
|
Serial1.begin(115200);
|
|
|
|
#if defined(PIN_WIRE_SDA) && defined(PIN_WIRE_SCL)
|
|
Wire.setPins(PIN_WIRE_SDA, PIN_WIRE_SCL);
|
|
#endif
|
|
|
|
Wire.begin();
|
|
|
|
delay(10);
|
|
}
|
|
#endif
|
|
|