Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
excludeAt a Glance

Prerequisites

Blinking LED

Now, let's modify the getting_started project to toggle an LED once a second. First, we'll use our Hardware Abstraction Library (HAL). As a refresher, the key purpose of a HAL is to abstract platform details into a common, portable API to allow developers to write high-level application code independently of the underlying hardware.

At this point, you should be familiar with the basics of our build system and flashed your first project. You should also be aware of our Git Workflow and Coding Standards.

Code Block
# Move to the firmware folder (if you weren't already there)
cd ~/shared/firmware
# Checkout the wip_getting_started branch (just in case)
git checkout wip_getting_started
# Check what branch we're on and if we have any changes
# This should say something along the lines of "nothing to commit, working directory clean"
git status

...

  • Most of our digital inputs and outputs are active-low. This means that GND (0V) is true/on and Vcc (3.3V) is false/off.
  • Did you notice the //'s and trailing commas in led and gpio_settings? To find out why, look at our Coding Standards. (Hint: It's related to clang-format)
  • On a similar note: prv_ as prefix for static functions, snake_case for variables, etc.

...