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.
Diff: main.cpp
- Revision:
- 5:64411d876ad4
- Parent:
- 4:97c886c2d89b
- Child:
- 6:45ca54a72865
diff -r 97c886c2d89b -r 64411d876ad4 main.cpp
--- a/main.cpp Wed Aug 20 07:50:37 2014 +0000
+++ b/main.cpp Wed Aug 20 10:44:42 2014 +0000
@@ -30,10 +30,10 @@
void CTest::callback1(void)
{
- pc.printf("callback1 called (this=0x%0X\n", this);
+ pc.printf("callback1 called (this=0x%0X)\n", this);
/* increment member variable */
-// counter++;
+ counter++;
}
void CTest::callback2(void* context)
@@ -41,17 +41,7 @@
pc.printf("Called with context value 0x%08X\n", context);
/* increment member variable */
-// counter = (uint32_t)context;
-}
-
-void CTest::callback3(void* context)
-{
- pc.printf("Called by ticker object 0x%08X: \n", context);
-}
-
-void CTest::callback4(uint32_t r0, uint32_t r1)
-{
- pc.printf("callback4: r0=0x%08X r1=0x%08X\n",r0, r1);
+ counter+=2;
}
void hexdump(const void* data, int length)
@@ -86,10 +76,11 @@
hexdump((const void*)entry, 16);
/* call entry point */
- pc.printf("before entry 1\n");
+ pc.printf("before entry 1 (counter=%i)\n", test.counter);
g_led2 = 1;
+ test.thunk.callback(&CTest::callback1);
entry();
- pc.printf("after entry 1\n");
+ pc.printf("after entry 1 (counter=%i)\n", test.counter);
/* TEST2: */
@@ -99,10 +90,10 @@
test.thunk.callback(&CTest::callback2);
/* call entry point */
- pc.printf("before entry 2\n");
+ pc.printf("before entry 2 (counter=%i)\n", test.counter);
g_led3 = 1;
entry();
- pc.printf("after entry 2\n");
+ pc.printf("after entry 2 (counter=%i)\n", test.counter);
}
int main(void)
@@ -118,5 +109,4 @@
g_led4 = 1;
while(1)
__WFI();
-// return 0;
}