A program that shows the use of $Sub$$ and $Super$$ to replace symbols at link time

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

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 }