Skip to content

Commit

Permalink
fixed GPIO due to renode's peripheral BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
thegabriele97 committed Feb 1, 2022
1 parent c963028 commit be4d7b9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/led.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,29 @@
*
*/
void turn_on_red_led(){
HAL_GPIO_WritePin(GPIO_BANK_LED, RED_LED_PIN, GPIO_PIN_SET);

GPIO_BANK_LED->ODR |= RED_LED_PIN;
}

/**
* @brief Used to turn off the red led placed at GPIO_BANK->RED_LED_PIN
*
*/
void turn_off_red_led(){
HAL_GPIO_WritePin(GPIO_BANK_LED, RED_LED_PIN, GPIO_PIN_RESET);
GPIO_BANK_LED->ODR &= ~RED_LED_PIN;
}

/**
* @brief Used to turn on the green led placed at GPIO_BANK->GREEN_LED_PIN
*
*/
void turn_on_green_led(){
HAL_GPIO_WritePin(GPIO_BANK_LED, GREEN_LED_PIN, GPIO_PIN_SET);
GPIO_BANK_LED->ODR |= GREEN_LED_PIN;
}

/**
* @brief Used to turn off the green led placed at GPIO_BANK->GREEN_LED_PIN
*
*/
void turn_off_green_led(){
HAL_GPIO_WritePin(GPIO_BANK_LED, GREEN_LED_PIN, GPIO_PIN_RESET);
GPIO_BANK_LED->ODR &= ~GREEN_LED_PIN;
}

0 comments on commit be4d7b9

Please sign in to comment.