diff --git a/.cproject b/.cproject
index 6c23bdc..43f1b19 100644
--- a/.cproject
+++ b/.cproject
@@ -45,6 +45,7 @@
-
+
diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml
index 9fe7414..7f04199 100644
--- a/.settings/language.settings.xml
+++ b/.settings/language.settings.xml
@@ -5,7 +5,7 @@
-
+
@@ -16,7 +16,7 @@
-
+
diff --git a/usrc/pluse_generator.c b/usrc/pluse_generator.c
index 19675a7..7864028 100644
--- a/usrc/pluse_generator.c
+++ b/usrc/pluse_generator.c
@@ -51,6 +51,10 @@ void prv_delay_us(uint32_t us) {
}
}
}
+static inline void set_io_state(int off, bool state) {
+ HAL_GPIO_WritePin(ch_io[off].gpio, ch_io[off].pinoff, state);
+ HAL_GPIO_WritePin(chx_io.gpio, chx_io.pinoff, state);
+}
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) {
if (GPIO_Pin != trigger_io.pinoff) {
@@ -105,11 +109,6 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) {
/*******************************************************************************
* FUNCTION *
*******************************************************************************/
-static inline void set_io_state(int off, bool state) {
- zgpio_write(&ch_io[off], state);
- // zdelay_us(1);
- zgpio_write(&chx_io, state);
-}
void PluseGenerator_init() {
//
@@ -131,16 +130,16 @@ void PluseGenerator_init() {
void PluseGenerator_updatePraram() {
config_t* cfg = config_get();
- m_steps[kaction_set_io0_high].tp = 1 + (cfg->pulse_width_us + cfg->pulse_interval_us) * 0;
- m_steps[kaction_set_io0_low].tp = 1 + (cfg->pulse_width_us + cfg->pulse_interval_us) * 0 + cfg->pulse_width_us;
- m_steps[kaction_set_io1_high].tp = 1 + (cfg->pulse_width_us + cfg->pulse_interval_us) * 1;
- m_steps[kaction_set_io1_low].tp = 1 + (cfg->pulse_width_us + cfg->pulse_interval_us) * 1 + cfg->pulse_width_us;
- m_steps[kaction_set_io2_high].tp = 1 + (cfg->pulse_width_us + cfg->pulse_interval_us) * 2;
- m_steps[kaction_set_io2_low].tp = 1 + (cfg->pulse_width_us + cfg->pulse_interval_us) * 2 + cfg->pulse_width_us;
- m_steps[kaction_set_io3_high].tp = 1 + (cfg->pulse_width_us + cfg->pulse_interval_us) * 3;
- m_steps[kaction_set_io3_low].tp = 1 + (cfg->pulse_width_us + cfg->pulse_interval_us) * 3 + cfg->pulse_width_us;
+ m_steps[kaction_set_io0_high].tp = 1 + ((cfg->pulse_width_us + cfg->pulse_interval_us) * 1) * 0;
+ m_steps[kaction_set_io0_low].tp = 1 + ((cfg->pulse_width_us + cfg->pulse_interval_us) * 1) * 0 + (cfg->pulse_width_us * 1);
+ m_steps[kaction_set_io1_high].tp = 1 + ((cfg->pulse_width_us + cfg->pulse_interval_us) * 1) * 1;
+ m_steps[kaction_set_io1_low].tp = 1 + ((cfg->pulse_width_us + cfg->pulse_interval_us) * 1) * 1 + (cfg->pulse_width_us * 1);
+ m_steps[kaction_set_io2_high].tp = 1 + ((cfg->pulse_width_us + cfg->pulse_interval_us) * 1) * 2;
+ m_steps[kaction_set_io2_low].tp = 1 + ((cfg->pulse_width_us + cfg->pulse_interval_us) * 1) * 2 + (cfg->pulse_width_us * 1);
+ m_steps[kaction_set_io3_high].tp = 1 + ((cfg->pulse_width_us + cfg->pulse_interval_us) * 1) * 3;
+ m_steps[kaction_set_io3_low].tp = 1 + ((cfg->pulse_width_us + cfg->pulse_interval_us) * 1) * 3 + (cfg->pulse_width_us * 1);
for (uint32_t i = 0; i < ZARRAY_SIZE(m_steps); i++) {
- printf("m_steps[%d].tp = %d\n", i, m_steps[i].tp);
+ // printf("m_steps[%d].tp = %d\n", i, m_steps[i].tp);
}
}