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.
Fork of System_7_14 by
StaticDefs.cpp
00001 #include "StaticDefs.hpp" 00002 00003 //Declare static global variables using 'construct on use' idiom to ensure they are always constructed correctly 00004 // and avoid "static initialization order fiasco". 00005 00006 Timer &systemTime() 00007 { 00008 static Timer s; 00009 return s; 00010 } 00011 00012 Serial & pc() 00013 { 00014 //static MODSERIAL p(USBTX, USBRX, 512, 64); // tx, rx 00015 static Serial p(USBTX, USBRX); 00016 return p; 00017 } 00018 00019 SpiADC & adc() 00020 { 00021 static SpiADC adc; 00022 return adc; 00023 } 00024 00025 PosVelFilter & pvf() 00026 { 00027 static PosVelFilter pvf; 00028 return pvf; 00029 } 00030 00031 PololuHBridge & hBridge() 00032 { 00033 static PololuHBridge hBridge(p25, p29, p30); 00034 return hBridge; 00035 } 00036 00037 PositionController & posCon() 00038 { 00039 static PositionController posCon; 00040 return posCon; 00041 }
Generated on Sun Aug 14 2022 12:28:28 by
1.7.2
