Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: 7_21_17_FSG 7_26_17_FSG
Fork of System_ by
StaticDefs.cpp
- Committer:
- tzyoung
- Date:
- 2017-04-27
- Revision:
- 1:e827d45c3948
- Parent:
- 0:45085dd174e7
- Child:
- 2:4698e312eadb
File content as of revision 1:e827d45c3948:
#include "StaticDefs.hpp" //Declare static global variables using 'construct on use' idiom to ensure they are always constructed correctly // and avoid "static initialization order fiasco". Timer &systemTime() { static Timer s; return s; } Serial & pc() { //static MODSERIAL p(USBTX, USBRX, 512, 64); // tx, rx static Serial p(USBTX, USBRX); return p; } SpiADC & adc() { static SpiADC adc; return adc; } PosVelFilter & pvf() { static PosVelFilter pvf; return pvf; } PololuHBridge & hBridge() { static PololuHBridge hBridge(p26, p29, p30); return hBridge; } PositionController & posCon() { static PositionController posCon; return posCon; }