Chris Styles
/
sub_super_functions
A program that shows the use of $Sub$$ and $Super$$ to replace symbols at link time
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 #include "function.h" 00003 00004 extern void $Super$$function(int i); 00005 00006 void $Sub$$function (int i) { 00007 DigitalOut led(LED3); 00008 led=i; 00009 wait(0.1); 00010 $Super$$function(i); 00011 } 00012 00013 int main() { 00014 00015 while(1) { 00016 function(1); 00017 wait(0.5); 00018 function(0); 00019 wait(0.5); 00020 } 00021 }
Generated on Wed Jul 13 2022 18:33:27 by 1.7.2