Enter Low Power mode not to use sd_power_system_off() subroutine
Dependents: BLE_EddystoneBeacon_w_ACC_TY51822 BLE_LoopbackUART_low_pwr_w_RTC1 BLE_Paired_Server BLE_Paired_Client
Diff: nRF51_lowpwr.cpp
- Revision:
- 1:4c3f4f1e154e
- Parent:
- 0:9ddf14df689c
- Child:
- 2:ffd5168de563
diff -r 9ddf14df689c -r 4c3f4f1e154e nRF51_lowpwr.cpp --- a/nRF51_lowpwr.cpp Wed Jun 01 10:55:02 2016 +0000 +++ b/nRF51_lowpwr.cpp Fri Jun 03 02:24:37 2016 +0000 @@ -6,7 +6,7 @@ * http://www.page.sannet.ne.jp/kenjia/index.html * http://mbed.org/users/kenjiArai/ * Started: April 30th, 2016 - * Revised: June 1st, 2016 + * Revised: June 3rd, 2016 * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE @@ -20,7 +20,7 @@ #include "nrf_delay.h" LowPwr::LowPwr(const nRF51_LOWPWR_TypeDef *param){ - if (!((param->std_printf_function == false) || (param->serial_function == true))){ + if ((param->std_printf_function == false) && (param->serial_function == false)){ //#warning "Disable Serial function (cannot use printf)!" NRF_UART0->ENABLE = 0; nrf_delay_us(5); @@ -50,7 +50,7 @@ nrf_delay_us(5); NRF_TWI1->POWER = 0; } - if (!((param->spi_function == false) || (param->spi_slave_function == true))){ + if ((param->spi_function == false) && (param->spi_slave_function == false)){ //#warning "Disable SPI function!" NRF_SPI0->INTENCLR = 0xffffffff; nrf_delay_us(5);