Tutorial 2 - SOS: This is an embedded program which controls LED1 in order to show a blinking SOS pattern. The tutorial starts to organize helper functions like "morse" in a brick library which will grow and grow with each tutorial. Platform specifics are identified in "bricks/platform.h" by setting proper defines (like LED_INVERTED), which are used to achieve platform independent behaviour. The program has been tested on Nordic nRF51-DK and STM NUCLEO-F303K8, NUCLEO-F401RE and NUCLEO-L476RG.

Dependencies:   mbed

bricks/target.h

Committer:
hux
Date:
2016-12-10
Revision:
1:10299215b49e
Parent:
bricks/platform.h@ 0:9bbb539e0614

File content as of revision 1:10299215b49e:

// bricks/target.h - define target specifics

#ifndef _BRICKS_TARGET_H_
#define _BRICKS_TARGET_H_

// platform specific defines - comment out platforms which are not used
// We work only with two kinds of platform:
//
//    a) a NUCLEO platform from STMicroelectronics
//    b) a nRF51 platform from Nordic Semiconductor
//
// If we have not a nRF51 target then we coclude it is a NUCLEO target. This is
// not really clean, but under above assumptions it works so far!

#ifdef TARGET_NRF51822 
#   define LED_INVERTED          // inverted LED for nRF51 targets
#endif

#endif // _BRICKS_TARGET_H_