mirror of
https://github.com/markqvist/RNode_Firmware.git
synced 2025-11-24 08:53:11 -05:00
Enable sleep on RAK4631
This commit is contained in:
parent
bbaddfbb66
commit
e7491b1eff
2 changed files with 16 additions and 1 deletions
6
Boards.h
6
Boards.h
|
|
@ -710,6 +710,7 @@
|
||||||
|
|
||||||
#elif MCU_VARIANT == MCU_NRF52
|
#elif MCU_VARIANT == MCU_NRF52
|
||||||
#if BOARD_MODEL == BOARD_RAK4631
|
#if BOARD_MODEL == BOARD_RAK4631
|
||||||
|
#define _PINNUM(port, pin) ((port) * 32 + (pin))
|
||||||
#define HAS_EEPROM false
|
#define HAS_EEPROM false
|
||||||
#define HAS_DISPLAY true
|
#define HAS_DISPLAY true
|
||||||
#define HAS_BLUETOOTH false
|
#define HAS_BLUETOOTH false
|
||||||
|
|
@ -722,6 +723,7 @@
|
||||||
#define HAS_RF_SWITCH_RX_TX true
|
#define HAS_RF_SWITCH_RX_TX true
|
||||||
#define HAS_BUSY true
|
#define HAS_BUSY true
|
||||||
#define HAS_INPUT true
|
#define HAS_INPUT true
|
||||||
|
#define HAS_SLEEP true
|
||||||
#define DIO2_AS_RF_SWITCH true
|
#define DIO2_AS_RF_SWITCH true
|
||||||
#define CONFIG_UART_BUFFER_SIZE 6144
|
#define CONFIG_UART_BUFFER_SIZE 6144
|
||||||
#define CONFIG_QUEUE_SIZE 6144
|
#define CONFIG_QUEUE_SIZE 6144
|
||||||
|
|
@ -731,7 +733,9 @@
|
||||||
#define BLE_MANUFACTURER "RAK Wireless"
|
#define BLE_MANUFACTURER "RAK Wireless"
|
||||||
#define BLE_MODEL "RAK4640"
|
#define BLE_MODEL "RAK4640"
|
||||||
|
|
||||||
const int pin_btn_usr1 = 31;
|
#define PIN_VEXT_EN _PINNUM(1, 2)
|
||||||
|
|
||||||
|
const int pin_btn_usr1 = _PINNUM(0, 31);
|
||||||
|
|
||||||
// Following pins are for the sx1262
|
// Following pins are for the sx1262
|
||||||
const int pin_rxen = 37;
|
const int pin_rxen = 37;
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,11 @@ void setup() {
|
||||||
pinMode(PIN_LED_GREEN, OUTPUT);
|
pinMode(PIN_LED_GREEN, OUTPUT);
|
||||||
pinMode(PIN_LED_BLUE, OUTPUT);
|
pinMode(PIN_LED_BLUE, OUTPUT);
|
||||||
delay(200);
|
delay(200);
|
||||||
|
#elif BOARD_MODEL == BOARD_RAK4631
|
||||||
|
delay(200);
|
||||||
|
pinMode(PIN_VEXT_EN, OUTPUT);
|
||||||
|
digitalWrite(PIN_VEXT_EN, HIGH);
|
||||||
|
delay(200);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!eeprom_begin()) { Serial.write("EEPROM initialisation failed.\r\n"); }
|
if (!eeprom_begin()) { Serial.write("EEPROM initialisation failed.\r\n"); }
|
||||||
|
|
@ -1773,6 +1778,12 @@ void sleep_now() {
|
||||||
delay(2000);
|
delay(2000);
|
||||||
analogWrite(PIN_VEXT_EN, 0);
|
analogWrite(PIN_VEXT_EN, 0);
|
||||||
delay(100);
|
delay(100);
|
||||||
|
#elif BOARD_MODEL == BOARD_RAK4631
|
||||||
|
#if HAS_DISPLAY
|
||||||
|
display_intensity = 0;
|
||||||
|
update_display(true);
|
||||||
|
#endif
|
||||||
|
analogWrite(PIN_VEXT_EN, 0);
|
||||||
#endif
|
#endif
|
||||||
sd_power_gpregret_set(0, 0x6d);
|
sd_power_gpregret_set(0, 0x6d);
|
||||||
nrf_gpio_cfg_sense_input(pin_btn_usr1, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);
|
nrf_gpio_cfg_sense_input(pin_btn_usr1, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue