Closed GitJer closed 5 years ago
When I try to assign FUNC_GPIO0 to pin 0, an error is raised in gpio.h line 32. Code:
#include <gpio.h> #include <fpioa.h> int main() { fpioa_set_function(0 , FUNC_GPIO0); gpio_set_drive_mode(0 , GPIO_DM_OUTPUT); while (1) { gpio_set_pin(0, GPIO_PV_HIGH); gpio_set_pin(0, GPIO_PV_LOW); } }
Error: ...kendryte-standalone-sdk/lib/drivers/gpio.c:32) io_number > 0
kendryte-standalone-sdk/lib/drivers/gpio.c:32) io_number > 0
The code that raises the error: configASSERT(io_number > 0);
configASSERT(io_number > 0);
If I change that line into: configASSERT(io_number >= 0); everything works fine.
configASSERT(io_number >= 0);
Is there a reason why pin 0 cannot be assigned the FUNC_GPIO0?
When I try to assign FUNC_GPIO0 to pin 0, an error is raised in gpio.h line 32. Code:
Error: ...
kendryte-standalone-sdk/lib/drivers/gpio.c:32) io_number > 0
The code that raises the error:
configASSERT(io_number > 0);
If I change that line into:
configASSERT(io_number >= 0);
everything works fine.Is there a reason why pin 0 cannot be assigned the FUNC_GPIO0?