diff --git a/cpg.c b/cpg.c index fd2f6b2..e02ace2 100644 --- a/cpg.c +++ b/cpg.c @@ -17,7 +17,7 @@ #define VERSION_DATE_MONTH 8 #define VERSION_DATE_DAY 8 #define VERSION_DATE_HOUR 16 -#define VERSION_DATE_MINUTE 11 +#define VERSION_DATE_MINUTE 14 static void cis_version(uint8_t *ins, uint16_t size) { NRF_LOG_INFO("%s", __FUNCTION__); @@ -104,7 +104,7 @@ const elite_instance_t cpg_elite_instance = { const elite_instance_t *cpg_init(void) { tw1508_init(); - tw1508_set(5, 5); // 5*0.23= 1.15mA, formula:value*0.23=mA + tw1508_set(5, 5); // 5*0.13= 0.65mA, formula:value*0.13=mA return &cpg_elite_instance; } diff --git a/cpg10_io.c b/cpg10_io.c index a8d6bb4..b223122 100644 --- a/cpg10_io.c +++ b/cpg10_io.c @@ -121,9 +121,9 @@ bool cpg10_pulse_start(uint32_t idx, pusle_gen_t *p_pusle_gen) break; case 0: default: - nrf_gpiote_task_configure(pusle_gen_hw[idx].gpiote_idx[0], p_pusle_gen->VAxH, NRF_GPIOTE_POLARITY_TOGGLE, NRF_GPIOTE_INITIAL_VALUE_LOW); + nrf_gpiote_task_configure(pusle_gen_hw[idx].gpiote_idx[0], p_pusle_gen->VBxH, NRF_GPIOTE_POLARITY_TOGGLE, NRF_GPIOTE_INITIAL_VALUE_HIGH); nrf_gpiote_task_configure(pusle_gen_hw[idx].gpiote_idx[1], p_pusle_gen->VBxL, NRF_GPIOTE_POLARITY_TOGGLE, NRF_GPIOTE_INITIAL_VALUE_LOW); - nrf_gpiote_task_configure(pusle_gen_hw[idx].gpiote_idx[2], p_pusle_gen->VBxH, NRF_GPIOTE_POLARITY_TOGGLE, NRF_GPIOTE_INITIAL_VALUE_LOW); + nrf_gpiote_task_configure(pusle_gen_hw[idx].gpiote_idx[2], p_pusle_gen->VAxH, NRF_GPIOTE_POLARITY_TOGGLE, NRF_GPIOTE_INITIAL_VALUE_HIGH); nrf_gpiote_task_configure(pusle_gen_hw[idx].gpiote_idx[3], p_pusle_gen->VAxL, NRF_GPIOTE_POLARITY_TOGGLE, NRF_GPIOTE_INITIAL_VALUE_LOW); break; } @@ -215,7 +215,7 @@ void cpg_pulse_default_demo(void) .point_us[4] = 1, .point_us[5] = 250, .point_us[6] = 1, - .pulse_cnt = 0, + .pulse_cnt = 0xFFFFFFFF, .op_mode = 0, }, { @@ -236,7 +236,7 @@ void cpg_pulse_default_demo(void) } }; - // cpg10_pulse_start(0, &pusle_gen[0]); //!!!hw problem, don't use + cpg10_pulse_start(0, &pusle_gen[0]); cpg10_pulse_start(1, &pusle_gen[1]); }