Skip to content

Commit

Permalink
Part 1 of 103 Hw Completed
Browse files Browse the repository at this point in the history
  • Loading branch information
AnmeetS committed Sep 16, 2024
1 parent 0916948 commit 64bb5fd
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions projects/fw_103/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,31 @@
#include "log.h"
#include "tasks.h"

#include "gpio.h"
#include "delay.h"

// GpioAddress struct
GpioAddress led_addr = {
.port = GPIO_PORT_B,
.pin = 3,
};

TASK(led_gpio_task, TASK_STACK_512) {
gpio_init_pin(&led_addr, GPIO_OUTPUT_PUSH_PULL, GPIO_STATE_LOW);
while(true) {
gpio_toggle_state(&led_addr);
LOG_DEBUG("Toggling LED\n"); // Added this line to see if something is even happening in the scons build
delay_ms(1000);
}
}

int main() {
tasks_init();
log_init();
gpio_init();

tasks_init_task(led_gpio_task, TASK_PRIORITY(1), NULL);

LOG_DEBUG("Welcome to FW 103!\n");

tasks_start();
Expand Down

0 comments on commit 64bb5fd

Please sign in to comment.