|
|
@ -26,19 +26,19 @@ static uint16_t m_capture_prepare_progress = 0; |
|
|
|
static void testlight_state(int val) { |
|
|
|
int effect = val % 3; |
|
|
|
if (effect == 0) { |
|
|
|
nrf_gpio_pin_write(LEDR, 1); |
|
|
|
nrf_gpio_pin_write(LEDG, 0); |
|
|
|
nrf_gpio_pin_write(LEDB, 0); |
|
|
|
// nrf_gpio_pin_write(LEDR, 1); |
|
|
|
// nrf_gpio_pin_write(LEDG, 0); |
|
|
|
// nrf_gpio_pin_write(LEDB, 0); |
|
|
|
nrf_gpio_pin_write(NRF_DBG_LED1, 1); |
|
|
|
} else if (effect == 1) { |
|
|
|
nrf_gpio_pin_write(LEDR, 0); |
|
|
|
nrf_gpio_pin_write(LEDG, 1); |
|
|
|
nrf_gpio_pin_write(LEDB, 0); |
|
|
|
// nrf_gpio_pin_write(LEDR, 0); |
|
|
|
// nrf_gpio_pin_write(LEDG, 1); |
|
|
|
// nrf_gpio_pin_write(LEDB, 0); |
|
|
|
nrf_gpio_pin_write(NRF_DBG_LED1, 0); |
|
|
|
} else if (effect == 2) { |
|
|
|
nrf_gpio_pin_write(LEDR, 0); |
|
|
|
nrf_gpio_pin_write(LEDG, 0); |
|
|
|
nrf_gpio_pin_write(LEDB, 1); |
|
|
|
// nrf_gpio_pin_write(LEDR, 0); |
|
|
|
// nrf_gpio_pin_write(LEDG, 0); |
|
|
|
// nrf_gpio_pin_write(LEDB, 1); |
|
|
|
nrf_gpio_pin_write(NRF_DBG_LED1, 0); |
|
|
|
} |
|
|
|
} |
|
|
@ -93,7 +93,8 @@ static void process_on_disconnect(void* arg) { ZLOGI("ble disconnected"); } |
|
|
|
void on_zapp_ebus_event(void* p_event_data, uint16_t event_size) { |
|
|
|
if (!p_event_data) return; |
|
|
|
app_event_t* p_event = (app_event_t*)p_event_data; |
|
|
|
ZLOGI("event:%d add_acid_key:%d reverse_key:%d", p_event->eventType, nrf_gpio_pin_read(ADD_ACID_KEY), nrf_gpio_pin_read(REVERSE_KEY)); |
|
|
|
// ZLOGI("event:%d add_acid_key:%d reverse_key:%d", p_event->eventType, nrf_gpio_pin_read(ADD_ACID_KEY), nrf_gpio_pin_read(REVERSE_KEY)); |
|
|
|
ZLOGI("event:%d", p_event->eventType); |
|
|
|
|
|
|
|
static int cnt = 0; |
|
|
|
cnt++; |
|
|
@ -133,14 +134,15 @@ void one_conduction_main() { |
|
|
|
// ADD_ACID_KEY |
|
|
|
// REVERSE_KEY |
|
|
|
|
|
|
|
nrf_gpio_cfg_input(ADD_ACID_KEY, NRF_GPIO_PIN_NOPULL); |
|
|
|
nrf_gpio_cfg_input(REVERSE_KEY, NRF_GPIO_PIN_NOPULL); |
|
|
|
// nrf_gpio_cfg_input(ADD_ACID_KEY, NRF_GPIO_PIN_NOPULL); |
|
|
|
// nrf_gpio_cfg_input(REVERSE_KEY, NRF_GPIO_PIN_NOPULL); |
|
|
|
|
|
|
|
|
|
|
|
nrf_gpio_cfg_output(LEDR); |
|
|
|
nrf_gpio_cfg_output(LEDG); |
|
|
|
nrf_gpio_cfg_output(LEDB); |
|
|
|
nrf_gpio_cfg_output(NRF_DBG_LED1); |
|
|
|
// nrf_gpio_cfg_output(LEDR); |
|
|
|
// nrf_gpio_cfg_output(LEDG); |
|
|
|
// nrf_gpio_cfg_output(LEDB); |
|
|
|
// nrf_gpio_cfg_output(NRF_DBG_LED1); |
|
|
|
znrf_gpio_cfg_output(NRF_DBG_LED1, NRF_GPIO_PIN_PULLUP); |
|
|
|
|
|
|
|
|
|
|
|
// adc_mgr_init(); |
|
|
|