-
Notifications
You must be signed in to change notification settings - Fork 53
Stm8 interrupt mode correction #2
Stm8 interrupt mode correction #2
Conversation
|
Can you update commit message to specify which port can or cannot be used ? |
| */ | ||
| /*As this port are not usable with exti, use dummy values*/ | ||
| #define EXTI_Port_A_Int ((uint8_t)0xFD) | ||
| #define EXTI_Port_C_Int ((uint8_t)0xFE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Means that we cannot use interrupts on ports A and C ?
In this case, how do you explain that we have the interrupt test working if we use D5 (PC2) on STM8L ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use it as "dummy" definition. In the case of stm8L we use the pin interrupt management and not the port. For some genericity , we keep these definitions.
That's why it works on D5 for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, would have been good to have those comments in the code.
| GPIO_mode = GPIO_Mode_In_FL_IT; | ||
| GPIO_Init(port, pin, GPIO_MODE_IN_PU_IT); | ||
| gpio_irq_conf[id].current_level = GPIO_ReadInputPin(port, pin); | ||
| EXTI_SetExtIntSensitivity(gpio_irq_conf[id].EXTI_port, EXTI_SENSITIVITY_RISE_FALL/*EXTI_mode*/); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it not possible to use other mode here ? Instead of compare current and old state in GPIO_EXTI_Callback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On STM8, when and interrupt falls, we have no idea which source is used.
For STM8S for example, we can only that the interrupt is coming from portX.
The other thing is that the interrupt sensivity is the same for all the port.
In the case a user, requires to use 2 different sensivities we need to check both falling and rising edges..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, thanks
This pull request provides a correction to support multiple interrupt sources on STM8S and STM8L.
On STM8S, PG0 (D4) cannot be used to test the interrupts. PG IO block doesn't support EXTI. You can use D0 instead for example.
If you are running the test_io exemple, carefull to check the available IOs and to reduce the clock speed of the example from 1000 to 800.