HWA
Bare metal programming with style
hwa/atmel/avr/examples/01-1-blink-soft/main.c
Blink a LED using a software loop

This program configures the LED pin as a digital output, then in an infinite loop it toggles the LED state and waits for half the period to be elapsed.

Symbols:

main.c
/* This file is part of the HWA project.
* Copyright (c) 2012,2015 Christophe Duparquet.
* All rights reserved. Read LICENSE.TXT for details.
*/
#include BOARD_H
#define PERIOD 0.5
int main ( )
{
hw( configure, PIN_LED, mode, digital_output );
for(;;) {
hw( toggle, PIN_LED );
hw_waste_cycles( PERIOD/2 * HW_SYSHZ );
}
}
hw
#define hw(...)
hw( action, object [,...] ) executes an action immediately on an object.
Definition: hwa_macros.h:523
hw_waste_cycles
#define hw_waste_cycles(n)
Definition: hwa_2.h:98