Chris Styles
/
sub_super_functions
A program that shows the use of $Sub$$ and $Super$$ to replace symbols at link time
Diff: main.cpp
- Revision:
- 0:1ec2d1478b47
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Sep 20 11:52:48 2012 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" +#include "function.h" + +extern void $Super$$function(int i); + +void $Sub$$function (int i) { + DigitalOut led(LED3); + led=i; + wait(0.1); + $Super$$function(i); +} + +int main() { + + while(1) { + function(1); + wait(0.5); + function(0); + wait(0.5); + } +}