You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
2.0 KiB
74 lines
2.0 KiB
#include "board.h"
|
|
#include "nrf_delay.h"
|
|
#include "project_cfg.h"
|
|
#include "sys.h"
|
|
#include "version.h"
|
|
#include "zble_service.h"
|
|
|
|
zble_service_cfg_t cfg = {.deviceName = "iflytop"};
|
|
|
|
#if 0
|
|
void developer_test(void) {
|
|
// 测试LED
|
|
debug_light_init(DEBUG_LIGHT_IO_INDEX);
|
|
|
|
// 测试BUTTON
|
|
uint8_t io_index[] = {11, 12, 24};
|
|
zbsp_gpio_state_monitor(1000, (uint8_t*)io_index, ZARRAY_SIZE(io_index));
|
|
|
|
// 测试睡眠唤醒
|
|
zbsp_enter_sleep(3000, 11, true);
|
|
}
|
|
#endif
|
|
// #define BUTTON_1
|
|
// #define BUTTON_2
|
|
void qingfengboard_test(void) {
|
|
// 测试LED
|
|
debug_light_init(15);
|
|
|
|
// 测试BUTTON
|
|
static uint8_t io_index[] = {ZPIN(0, 5), ZPIN(1, 9)};
|
|
zbsp_gpio_state_monitor(1000, (uint8_t*)io_index, ZARRAY_SIZE(io_index));
|
|
|
|
// 测试睡眠唤醒
|
|
zbsp_enter_sleep(3000, 5, true);
|
|
}
|
|
|
|
int main(void) {
|
|
// zsys_init();
|
|
|
|
// NRF_LOG_INFO("compile time :%s", __TIME__);
|
|
// NRF_LOG_INFO("Version :%d", VERSION);
|
|
// NRF_LOG_INFO("Manufacturer :%s", MANUFACTURER_NAME);
|
|
|
|
/*******************************************************************************
|
|
* 开发板测试 *
|
|
*******************************************************************************/
|
|
// 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();
|
|
}
|