Merge pull request #1172 from oltaco/nrf52-power-changes
NRF52 Power related changes
This commit is contained in:
@@ -11,8 +11,6 @@ void MinewsemiME25LS01Board::begin() {
|
|||||||
|
|
||||||
pinMode(PIN_VBAT_READ, INPUT);
|
pinMode(PIN_VBAT_READ, INPUT);
|
||||||
|
|
||||||
sd_power_mode_set(NRF_POWER_MODE_LOWPWR);
|
|
||||||
|
|
||||||
#ifdef BUTTON_PIN
|
#ifdef BUTTON_PIN
|
||||||
pinMode(BUTTON_PIN, INPUT);
|
pinMode(BUTTON_PIN, INPUT);
|
||||||
pinMode(LED_PIN, OUTPUT);
|
pinMode(LED_PIN, OUTPUT);
|
||||||
|
|||||||
@@ -21,7 +21,15 @@ static void disconnect_callback(uint16_t conn_handle, uint8_t reason) {
|
|||||||
void RAKWismeshTagBoard::begin() {
|
void RAKWismeshTagBoard::begin() {
|
||||||
// for future use, sub-classes SHOULD call this from their begin()
|
// for future use, sub-classes SHOULD call this from their begin()
|
||||||
startup_reason = BD_STARTUP_NORMAL;
|
startup_reason = BD_STARTUP_NORMAL;
|
||||||
NRF_POWER->DCDCEN = 1;
|
|
||||||
|
// Enable DC/DC converter for improved power efficiency
|
||||||
|
uint8_t sd_enabled = 0;
|
||||||
|
sd_softdevice_is_enabled(&sd_enabled);
|
||||||
|
if (sd_enabled) {
|
||||||
|
sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE);
|
||||||
|
} else {
|
||||||
|
NRF_POWER->DCDCEN = 1;
|
||||||
|
}
|
||||||
|
|
||||||
pinMode(PIN_VBAT_READ, INPUT);
|
pinMode(PIN_VBAT_READ, INPUT);
|
||||||
pinMode(PIN_USER_BTN, INPUT_PULLUP);
|
pinMode(PIN_USER_BTN, INPUT_PULLUP);
|
||||||
|
|||||||
@@ -9,10 +9,14 @@ void T1000eBoard::begin() {
|
|||||||
startup_reason = BD_STARTUP_NORMAL;
|
startup_reason = BD_STARTUP_NORMAL;
|
||||||
btn_prev_state = HIGH;
|
btn_prev_state = HIGH;
|
||||||
|
|
||||||
sd_power_mode_set(NRF_POWER_MODE_LOWPWR);
|
|
||||||
|
|
||||||
// Enable DC/DC converter for improved power efficiency
|
// Enable DC/DC converter for improved power efficiency
|
||||||
NRF_POWER->DCDCEN = 1;
|
uint8_t sd_enabled = 0;
|
||||||
|
sd_softdevice_is_enabled(&sd_enabled);
|
||||||
|
if (sd_enabled) {
|
||||||
|
sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE);
|
||||||
|
} else {
|
||||||
|
NRF_POWER->DCDCEN = 1;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef BUTTON_PIN
|
#ifdef BUTTON_PIN
|
||||||
pinMode(BATTERY_PIN, INPUT);
|
pinMode(BATTERY_PIN, INPUT);
|
||||||
|
|||||||
@@ -23,8 +23,14 @@ static void disconnect_callback(uint16_t conn_handle, uint8_t reason) {
|
|||||||
void WioWM1110Board::begin() {
|
void WioWM1110Board::begin() {
|
||||||
startup_reason = BD_STARTUP_NORMAL;
|
startup_reason = BD_STARTUP_NORMAL;
|
||||||
|
|
||||||
sd_power_mode_set(NRF_POWER_MODE_LOWPWR);
|
// Enable DC/DC converter for improved power efficiency
|
||||||
NRF_POWER->DCDCEN = 1;
|
uint8_t sd_enabled = 0;
|
||||||
|
sd_softdevice_is_enabled(&sd_enabled);
|
||||||
|
if (sd_enabled) {
|
||||||
|
sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE);
|
||||||
|
} else {
|
||||||
|
NRF_POWER->DCDCEN = 1;
|
||||||
|
}
|
||||||
|
|
||||||
pinMode(BATTERY_PIN, INPUT);
|
pinMode(BATTERY_PIN, INPUT);
|
||||||
pinMode(LED_GREEN, OUTPUT);
|
pinMode(LED_GREEN, OUTPUT);
|
||||||
|
|||||||
@@ -23,7 +23,15 @@ static void disconnect_callback(uint16_t conn_handle, uint8_t reason) {
|
|||||||
void XiaoNrf52Board::begin() {
|
void XiaoNrf52Board::begin() {
|
||||||
// for future use, sub-classes SHOULD call this from their begin()
|
// for future use, sub-classes SHOULD call this from their begin()
|
||||||
startup_reason = BD_STARTUP_NORMAL;
|
startup_reason = BD_STARTUP_NORMAL;
|
||||||
NRF_POWER->DCDCEN = 1;
|
|
||||||
|
// Enable DC/DC converter for improved power efficiency
|
||||||
|
uint8_t sd_enabled = 0;
|
||||||
|
sd_softdevice_is_enabled(&sd_enabled);
|
||||||
|
if (sd_enabled) {
|
||||||
|
sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE);
|
||||||
|
} else {
|
||||||
|
NRF_POWER->DCDCEN = 1;
|
||||||
|
}
|
||||||
|
|
||||||
pinMode(PIN_VBAT, INPUT);
|
pinMode(PIN_VBAT, INPUT);
|
||||||
pinMode(VBAT_ENABLE, OUTPUT);
|
pinMode(VBAT_ENABLE, OUTPUT);
|
||||||
|
|||||||
Reference in New Issue
Block a user