jamesturton / shelly-dimmer-stm32

Open-source firmware for STM32 co-processor on the Shelly Dimmer.
GNU General Public License v3.0
53 stars 16 forks source link

Not an issue, just a question #20

Closed Mollayo closed 3 years ago

Mollayo commented 3 years ago

@jamesturton Thank you for putting your source code for the STM32 firmware. I have one question. The two functions (tim1_cc_isr and exti2_3_isr) are called for the zero crossing of the voltage. But it there a way to detect if the voltage is negative or positive ? My plan is to develop a firmware for this protocol.

jamesturton commented 3 years ago

It is the exti2_3_isr function which is called at the zero crossing point. So when this is called you can check the pin directly if it high or low (like I have done here) to see if it is high or low. I'm not sure if high on that pin means positive or negative - you will have to check that!

Mollayo commented 3 years ago

Thank you !