fix: gpio 初始化過調整, 移除 enable_6994_callback()
This commit is contained in:
@@ -134,6 +134,29 @@ static void le_stack_Init(void)
|
||||
|
||||
void gpio_init(void)
|
||||
{
|
||||
nrf_gpio_pin_set(POWER_5V_EN_PIN);
|
||||
nrf_gpio_pin_set(POWER_12V_EN_PIN);
|
||||
nrf_gpio_pin_set(CS_SW_PIN);
|
||||
nrf_gpio_pin_set(CS_MEM_PIN);
|
||||
nrf_gpio_pin_set(CS_ADC_PIN);
|
||||
nrf_gpio_pin_set(CS_DAC_PIN);
|
||||
nrf_gpio_pin_set(OFF_PIN);
|
||||
|
||||
nrf_gpio_pin_clear(Vout_FB_PIN);
|
||||
nrf_gpio_pin_clear(Vout_IN_PIN);
|
||||
nrf_gpio_pin_clear(Iin4_TEST_PIN);
|
||||
nrf_gpio_pin_clear(Iin3_SEL_PIN);
|
||||
nrf_gpio_pin_clear(Iin3_PIN);
|
||||
nrf_gpio_pin_clear(Iin2_PIN);
|
||||
nrf_gpio_pin_clear(Iin1_PIN);
|
||||
nrf_gpio_pin_clear(Vin2_PIN);
|
||||
nrf_gpio_pin_clear(Vin1_PIN);
|
||||
nrf_gpio_pin_clear(CV_CTRL_PIN);
|
||||
nrf_gpio_pin_clear(ADCA2_PIN);
|
||||
nrf_gpio_pin_clear(ADCA1_PIN);
|
||||
nrf_gpio_pin_clear(ADCA0_PIN);
|
||||
nrf_gpio_pin_clear(RST_SW_PIN);
|
||||
|
||||
nrf_gpio_cfg_output(POWER_5V_EN_PIN);
|
||||
nrf_gpio_cfg_output(POWER_12V_EN_PIN);
|
||||
nrf_gpio_cfg_output(OFF_PIN);
|
||||
@@ -159,35 +182,6 @@ void gpio_init(void)
|
||||
nrf_gpio_cfg_input(VBAT_PIN, NRF_GPIO_PIN_NOPULL);
|
||||
nrf_gpio_cfg_input(SHUT_DOWN_PIN, NRF_GPIO_PIN_NOPULL);
|
||||
nrf_gpio_cfg_input(INT9466_PIN, NRF_GPIO_PIN_NOPULL);
|
||||
|
||||
nrf_gpio_pin_set(POWER_5V_EN_PIN);
|
||||
nrf_gpio_pin_set(POWER_12V_EN_PIN);
|
||||
nrf_gpio_pin_set(OFF_PIN); // disable 6994
|
||||
nrf_gpio_pin_set(CS_SW_PIN);
|
||||
nrf_gpio_pin_set(CS_MEM_PIN);
|
||||
nrf_gpio_pin_set(CS_ADC_PIN);
|
||||
nrf_gpio_pin_set(CS_DAC_PIN);
|
||||
|
||||
nrf_gpio_pin_clear(Vout_FB_PIN);
|
||||
nrf_gpio_pin_clear(Vout_IN_PIN);
|
||||
nrf_gpio_pin_clear(Iin4_TEST_PIN);
|
||||
nrf_gpio_pin_clear(Iin3_SEL_PIN);
|
||||
nrf_gpio_pin_clear(Iin3_PIN);
|
||||
nrf_gpio_pin_clear(Iin2_PIN);
|
||||
nrf_gpio_pin_clear(Iin1_PIN);
|
||||
nrf_gpio_pin_clear(Vin2_PIN);
|
||||
nrf_gpio_pin_clear(Vin1_PIN);
|
||||
nrf_gpio_pin_clear(CV_CTRL_PIN);
|
||||
nrf_gpio_pin_clear(ADCA2_PIN);
|
||||
nrf_gpio_pin_clear(ADCA1_PIN);
|
||||
nrf_gpio_pin_clear(ADCA0_PIN);
|
||||
nrf_gpio_pin_clear(RST_SW_PIN);
|
||||
}
|
||||
|
||||
static void enable_6994_callback(void *pvParameter)
|
||||
{
|
||||
nrf_gpio_pin_clear(OFF_PIN); // enable 6994
|
||||
NRF_LOG_INFO("enable 6994");
|
||||
}
|
||||
|
||||
static void nrf_sdh_freertos_task_hook(void *p_context)
|
||||
@@ -221,11 +215,6 @@ static void nrf_sdh_freertos_task_hook(void *p_context)
|
||||
|
||||
extern void le_adv_init(uint8_t ble_conn_cfg_tag);
|
||||
le_adv_init(APP_BLE_CONN_CFG_TAG); // could be scanned
|
||||
|
||||
/* Start timer to call enable_6994_callback() */
|
||||
TimerHandle_t timer_handle; /**< Reference to counter FreeRTOS timer. */
|
||||
timer_handle = xTimerCreate("enable 6994", 1000, pdFALSE, NULL, enable_6994_callback); // 1000ms no repeat
|
||||
xTimerStart(timer_handle, 0);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
|
||||
Reference in New Issue
Block a user