|
@ -9,16 +9,16 @@ |
|
|
#include "app_ble_service.h" |
|
|
#include "app_ble_service.h" |
|
|
#include "app_event_distribute.h" |
|
|
#include "app_event_distribute.h" |
|
|
#include "basic/ads1293/ads1293.h" |
|
|
#include "basic/ads1293/ads1293.h" |
|
|
|
|
|
#include "basic/device_version_info_mgr.h" |
|
|
#include "board/board.h" |
|
|
#include "board/board.h" |
|
|
#include "device_ctrl_service.h" |
|
|
#include "device_ctrl_service.h" |
|
|
#include "zble_module.h" |
|
|
#include "zble_module.h" |
|
|
#include "zdatachannel_service.h" |
|
|
#include "zdatachannel_service.h" |
|
|
#include "basic/device_version_info_mgr.h" |
|
|
|
|
|
// |
|
|
|
|
|
|
|
|
|
|
|
int main() { |
|
|
int main() { |
|
|
APP_SCHED_INIT(APP_MAX_EVEN_SIZE, APP_EVENT_QUEUE_SIZE); |
|
|
APP_SCHED_INIT(APP_MAX_EVEN_SIZE, APP_EVENT_QUEUE_SIZE); |
|
|
znordic_init(); |
|
|
znordic_init(); |
|
|
|
|
|
|
|
|
NRF_LOG_INFO("compile time :%s", __TIME__); |
|
|
NRF_LOG_INFO("compile time :%s", __TIME__); |
|
|
/******************************************************************************* |
|
|
/******************************************************************************* |
|
|
* 蓝牙服务初始化 * |
|
|
* 蓝牙服务初始化 * |
|
@ -31,11 +31,46 @@ int main() { |
|
|
/******************************************************************************* |
|
|
/******************************************************************************* |
|
|
* 设备控制服务初始化 * |
|
|
* 设备控制服务初始化 * |
|
|
*******************************************************************************/ |
|
|
*******************************************************************************/ |
|
|
DeviceCtrl_init(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nrf_gpio_cfg_input(ADS1293_SPI_SCK_PIN, NRF_GPIO_PIN_NOPULL); |
|
|
|
|
|
nrf_gpio_cfg_input(ADS1293_SPI_MOSI_PIN, NRF_GPIO_PIN_NOPULL); |
|
|
|
|
|
nrf_gpio_cfg_input(ADS1293_SPI_MISO_PIN, NRF_GPIO_PIN_NOPULL); |
|
|
|
|
|
nrf_gpio_cfg_input(ADS1293_SPI_CS0_PIN, NRF_GPIO_PIN_NOPULL); |
|
|
|
|
|
nrf_gpio_cfg_input(ADS1293_SPI_CS1_PIN, NRF_GPIO_PIN_NOPULL); |
|
|
|
|
|
nrf_gpio_cfg_input(ADS1293_READY_PIN, NRF_GPIO_PIN_NOPULL); |
|
|
|
|
|
nrf_gpio_cfg_input(LINE_DET_PIN, NRF_GPIO_PIN_NOPULL); |
|
|
|
|
|
nrf_gpio_cfg_input(SDCARD_SPI_SCK_PIN, NRF_GPIO_PIN_NOPULL); |
|
|
|
|
|
nrf_gpio_cfg_input(SDCARD_SPI_CS_PIN, NRF_GPIO_PIN_NOPULL); |
|
|
|
|
|
nrf_gpio_cfg_input(SDCARD_SPI_MISO_PIN, NRF_GPIO_PIN_NOPULL); |
|
|
|
|
|
nrf_gpio_cfg_input(SDCARD_SPI_MOSI_PIN, NRF_GPIO_PIN_NOPULL); |
|
|
|
|
|
nrf_gpio_cfg_input(SDCARD_USBDRIVER_IC_JUNCTION_CTRL_NOE_PIN, NRF_GPIO_PIN_NOPULL); |
|
|
|
|
|
nrf_gpio_cfg_input(SDCARD_USBDRIVER_IC_RESET_PIN, NRF_GPIO_PIN_NOPULL); |
|
|
|
|
|
nrf_gpio_cfg_input(ADS1293_SPI_INSTANCE, NRF_GPIO_PIN_NOPULL); |
|
|
|
|
|
nrf_gpio_cfg_input(BEEP_PWM_INSTANCE, NRF_GPIO_PIN_NOPULL); |
|
|
|
|
|
nrf_gpio_cfg_input(LIGHT_PWM_INSTANCE, NRF_GPIO_PIN_NOPULL); |
|
|
|
|
|
nrf_gpio_cfg_input(BATTERY_ADC_CHANNEL, NRF_GPIO_PIN_NOPULL); |
|
|
|
|
|
nrf_gpio_cfg_input(LED_GREEN_PIN, NRF_GPIO_PIN_NOPULL); |
|
|
|
|
|
nrf_gpio_cfg_input(BEEP_PIN, NRF_GPIO_PIN_NOPULL); |
|
|
|
|
|
|
|
|
|
|
|
znrf_gpio_cfg_output(SDCARD_POWER_CTRL_PIN, NRF_GPIO_PIN_PULLUP); |
|
|
|
|
|
nrf_gpio_pin_write(SDCARD_POWER_CTRL_PIN, 1); // POWER = 0 打开电源 |
|
|
|
|
|
|
|
|
|
|
|
BoardButton_enable_sense(); |
|
|
|
|
|
|
|
|
|
|
|
nrf_delay_ms(1000); |
|
|
|
|
|
|
|
|
|
|
|
app_timer_pause(); |
|
|
|
|
|
nrf_sdh_suspend(); |
|
|
|
|
|
nrf_sdh_disable_request(); |
|
|
|
|
|
sd_power_system_off(); |
|
|
|
|
|
NVIC_SystemReset(); |
|
|
|
|
|
|
|
|
|
|
|
znordic_loop(); |
|
|
|
|
|
|
|
|
/******************************************************************************* |
|
|
/******************************************************************************* |
|
|
* LOOP * |
|
|
* LOOP * |
|
|
*******************************************************************************/ |
|
|
*******************************************************************************/ |
|
|
znordic_loop(); |
|
|
|
|
|
} |
|
|
} |
|
|
#else |
|
|
#else |
|
|
#include "ads1293_simple_tester.c" |
|
|
#include "ads1293_simple_tester.c" |