Browse Source

update

3lead_uart_test_ok_version
zhaohe 1 year ago
parent
commit
e83ea1c4b3
  1. 32
      app/main.c
  2. 20
      app/src/three_lead/three_lead_board.c

32
app/main.c

@ -423,9 +423,41 @@ void main() {
ThreeLeadECG_sdcard_base_init();
ThreeLeadECG_sdcard_mount();
ThreeLeadECG_sdcard_umount();
ThreeLeadECG_sdcard_mount();
ThreeLeadECG_sdcard_umount();
ZERROR_CHECK(app_timer_create(&m_test_tx_timer, APP_TIMER_MODE_REPEATED, test_tx_timer_cb));
ZERROR_CHECK(app_timer_start(m_test_tx_timer, APP_TIMER_TICKS(100), NULL));
znordic_loop();
}
#endif
#if 0
/*******************************************************************************
* 3-flash测试 *
*******************************************************************************/
static void test_tx_timer_cb(void* p_context) {
static uint32_t data;
data++;
ZLOGI("button %d", ThreeLeadECG_button_get_state());
}
extern uint32_t g_nrf_log_tx_pin;
APP_TIMER_DEF(m_test_tx_timer);
void main() {
APP_SCHED_INIT(APP_TIMER_SCHED_EVENT_DATA_SIZE, 20);
znordic_init();
NRF_LOG_INFO("compile time :%s %d", __TIME__, APP_TIMER_TICKS(100));
NRF_LOG_INTERNAL_FLUSH();
ThreeLeadECG_button_init();
ZERROR_CHECK(app_timer_create(&m_test_tx_timer, APP_TIMER_MODE_REPEATED, test_tx_timer_cb));
ZERROR_CHECK(app_timer_start(m_test_tx_timer, APP_TIMER_TICKS(300), NULL));
znordic_loop();
}
#endif

20
app/src/three_lead/three_lead_board.c

@ -200,10 +200,10 @@ void ThreeLeadECG_sdcard_init() {
* 4. flash电源
*
*/
ThreeLeadECG_sdcard_base_init(); //
ThreeLeadECG_sdcard_spi_umount(); //
ThreeLeadECG_sdcard_connect2_ext_usb_sdcard_driver_ic(true);
ThreeLeadECG_sdcard_flash_power_ctrl(true);
ThreeLeadECG_sdcard_base_init(); //
// ThreeLeadECG_sdcard_spi_umount(); //
// ThreeLeadECG_sdcard_connect2_ext_usb_sdcard_driver_ic(true);
// ThreeLeadECG_sdcard_flash_power_ctrl(true);
}
NRF_BLOCK_DEV_SDC_DEFINE(m_block_dev_sdc, //
@ -374,9 +374,15 @@ void ThreeLeadECG_sdcard_umount() {
f_mount(NULL, "", 1);
disk_uninitialize(0);
ThreeLeadECG_sdcard_spi_umount();
ThreeLeadECG_sdcard_flash_power_ctrl(false);
ThreeLeadECG_sdcard_connect2_ext_usb_sdcard_driver_ic(true);
ThreeLeadECG_sdcard_flash_power_ctrl(true);
nrf_gpio_pin_write(SDCARD_POWER_CTRL_PIN, 1); //
nrf_gpio_pin_write(SDCARD_USBDRIVER_IC_JUNCTION_CTRL_NOE_PIN, 0);
nrf_delay_ms(100);
nrf_gpio_pin_write(SDCARD_POWER_CTRL_PIN, 0); //
nrf_gpio_pin_write(SDCARD_USBDRIVER_IC_RESET_PIN, 0);
nrf_delay_ms(10);
nrf_gpio_pin_write(SDCARD_USBDRIVER_IC_RESET_PIN, 1);
}
/*******************************************************************************

Loading…
Cancel
Save