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.
Dependencies: BufferedSerial C12832 EndpointMain-rfid EthernetInterface Logger StatusReporter-df2014 mbed-rtos mbed
Fork of df-2014-workshop-rfid-case-generator-k64f by
Diff: main.cpp
- Revision:
- 27:9bb430dd6c07
- Parent:
- 25:89a505a8e61c
- Child:
- 28:892a6668365f
--- a/main.cpp Fri Aug 29 21:39:40 2014 +0000
+++ b/main.cpp Sun Sep 07 22:19:30 2014 +0000
@@ -44,8 +44,21 @@
// HARD RESET
extern "C" void HardFault_Handler() { NVIC_SystemReset(); }
- // Main Entry...
- int main() {
+// WEAK Function for debugging
+extern "C" void mbed_mac_address(char * mac) {
+ mac[0] = 0x44;
+ mac[1] = 0x45;
+ mac[2] = 0x56;
+ mac[3] = 0x67;
+ mac[4] = 0x78;
+ mac[5] = 0x89;
+ pc.printf("MAC " );
+ for(int i=0;i<6;++i) pc.printf(":%.2x",mac[i]);
+ pc.printf("\r\n");
+}
+
+ // Main Task...
+ void mainTask(void const *v) {
// create our object instances
#if _NXP_PLATFORM || _UBLOX_PLATFORM
ErrorHandler logger(&pc,&lcd);
@@ -100,4 +113,14 @@
logger.log("Exiting...");
logger.turnLEDBlue();
exit(1);
+ }
+
+ // main entry
+ int main() {
+ #if _K64F_PLATFORM
+ Thread workerTask(mainTask, NULL, osPriorityNormal, STACK_SIZE);
+ while (true) Thread::wait(10*WAIT_TIME_MS);
+ #else
+ mainTask(NULL);
+ #endif
}
\ No newline at end of file

