diff --git a/.vscode/settings.json b/.vscode/settings.json index 39ffa52..a818b7e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -36,6 +36,7 @@ "board.h": "c", "stdio.h": "c", "nrf_log_ctrl.h": "c", - "nrf_log_default_backends.h": "c" + "nrf_log_default_backends.h": "c", + "nrf_delay.h": "c" } } \ No newline at end of file diff --git a/app/config/sdk_config.h b/app/config/sdk_config.h index 89f20aa..3716597 100644 --- a/app/config/sdk_config.h +++ b/app/config/sdk_config.h @@ -7606,7 +7606,7 @@ // NRF_LOG_BACKEND_RTT_ENABLED - nrf_log_backend_rtt - Log RTT backend //========================================================== #ifndef NRF_LOG_BACKEND_RTT_ENABLED -#define NRF_LOG_BACKEND_RTT_ENABLED 1 +#define NRF_LOG_BACKEND_RTT_ENABLED 0 #endif // NRF_LOG_BACKEND_RTT_TEMP_BUFFER_SIZE - Size of buffer for partially processed strings. // Size of the buffer is a trade-off between RAM usage and processing. @@ -7639,7 +7639,7 @@ // NRF_LOG_ENABLED - nrf_log - Logger //========================================================== #ifndef NRF_LOG_ENABLED -#define NRF_LOG_ENABLED 1 +#define NRF_LOG_ENABLED 0 #endif // Log message pool - Configuration of log message pool @@ -10590,7 +10590,7 @@ #ifndef NRF_LOG_STR_FORMATTER_TIMESTAMP_FORMAT_ENABLED -#define NRF_LOG_STR_FORMATTER_TIMESTAMP_FORMAT_ENABLED 1 +#define NRF_LOG_STR_FORMATTER_TIMESTAMP_FORMAT_ENABLED 0 #endif // diff --git a/app/main.c b/app/main.c index d8796f7..d24c331 100644 --- a/app/main.c +++ b/app/main.c @@ -1,4 +1,5 @@ #include "board.h" +#include "nrf_delay.h" #include "project_cfg.h" #include "sys.h" #include "version.h" @@ -30,19 +31,44 @@ void qingfengboard_test(void) { zbsp_gpio_state_monitor(1000, (uint8_t*)io_index, ZARRAY_SIZE(io_index)); // 测试睡眠唤醒 - // zbsp_enter_sleep(3000, 5, true); + zbsp_enter_sleep(3000, 5, true); } int main(void) { - zsys_init(); + // zsys_init(); - NRF_LOG_INFO("compile time :%s", __TIME__); - NRF_LOG_INFO("Version :%d", VERSION); - NRF_LOG_INFO("Manufacturer :%s", MANUFACTURER_NAME); + // NRF_LOG_INFO("compile time :%s", __TIME__); + // NRF_LOG_INFO("Version :%d", VERSION); + // NRF_LOG_INFO("Manufacturer :%s", MANUFACTURER_NAME); /******************************************************************************* * 开发板测试 * *******************************************************************************/ - qingfengboard_test(); + // qingfengboard_test(); + // ret_code_t err_code = NRF_LOG_INIT(NULL); + // APP_ERROR_CHECK(err_code); + // NRF_LOG_DEFAULT_BACKENDS_INIT(); + nrf_pwr_mgmt_init(); + nrf_gpio_cfg(15, // + NRF_GPIO_PIN_DIR_OUTPUT, // + NRF_GPIO_PIN_INPUT_DISCONNECT, // + NRF_GPIO_PIN_PULLUP, // + NRF_GPIO_PIN_S0S1, // + NRF_GPIO_PIN_NOSENSE); + nrf_delay_ms(1000); + for (size_t i = 0; i < 3; i++) { + nrf_gpio_pin_set(15); + nrf_delay_ms(300); + nrf_gpio_pin_clear(15); + nrf_delay_ms(300); + } + + sd_power_system_off(); + for (size_t i = 0; i < 3; i++) { + nrf_gpio_pin_set(15); + nrf_delay_ms(100); + nrf_gpio_pin_clear(15); + nrf_delay_ms(100); + } zsys_loop(); }