Skip to content
This repository was archived by the owner on Mar 31, 2023. It is now read-only.

Conversation

@lcharpenwi6labs
Copy link
Contributor

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.

@ghost ghost requested review from VVESTM and fpistm September 18, 2018 07:43
@VVESTM
Copy link
Contributor

VVESTM commented Sep 18, 2018

Can you update commit message to specify which port can or cannot be used ?
If looking to the code, we see that we cannot use G, A and C.

*/
/*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)
Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

Copy link
Contributor

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*/);
Copy link
Contributor

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.

Copy link
Contributor Author

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..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, thanks

@VVESTM VVESTM merged commit 14f6a9b into stm32duino:master Oct 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants