Added multiple uBASIC program objects to stm32f4xx example port. (#995)

This commit is contained in:
Steve Karg
2025-05-19 14:57:43 -05:00
committed by GitHub
parent 62bf8274f7
commit b5b2fd5b7b
9 changed files with 218 additions and 80 deletions
+11 -17
View File
@@ -312,23 +312,17 @@ static void gpio_config(uint8_t ch, int8_t mode, uint8_t freq)
*/
static void gpio_write(uint8_t ch, uint8_t pin_state)
{
switch (ch) {
case 1:
if (pin_state) {
led_on(LED_LD1);
} else {
led_off(LED_LD1);
}
break;
case 2:
if (pin_state) {
led_on(LED_LD2);
} else {
led_off(LED_LD2);
}
break;
default:
break;
unsigned int led_index;
if (ch == 0) {
return;
}
/* adjust for zero based index */
led_index = ch - 1;
if (pin_state) {
led_on(led_index);
} else {
led_off(led_index);
}
}