This is a test program for FirmwareUpdater.

Dependencies:   mbed FirmwareUpdater EthernetNetIf

Files at this revision

API Documentation at this revision

Comitter:
shintamainjp
Date:
Fri Nov 05 12:30:53 2010 +0000
Parent:
4:e742ea7a3d20
Commit message:
Changed output messages.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Nov 05 12:16:48 2010 +0000
+++ b/main.cpp	Fri Nov 05 12:30:53 2010 +0000
@@ -1,6 +1,7 @@
 /**
  * =============================================================================
  * A test program for firmware updater (Version 0.0.2)
+ * http://mbed.org/users/shintamainjp/notebook/firmwareupdater_en/
  * =============================================================================
  * Copyright (c) 2010 Shinichiro Nakamura (CuBeatSystems)
  *
@@ -28,10 +29,11 @@
 #include "FirmwareUpdater.h"
 #include "EthernetNetIf.h"
 
-#define ON_A_SERVER 0
+#define APPLICATION_NAME "firm"
+#define SERVER_VERSION 0
 
 EthernetNetIf eth;
-FirmwareUpdater fwup("http://mbed.org/media/uploads/shintamainjp/", "firm", true);
+FirmwareUpdater fwup("http://mbed.org/media/uploads/shintamainjp/", APPLICATION_NAME, true);
 BusOut led(LED4, LED3, LED2, LED1);
 Ticker ticker;
 
@@ -63,11 +65,11 @@
 int main() {
     eth.setup();
 
-#if ON_A_SERVER
-    printf("Version on the server.\n");
+#if SERVER_VERSION
+    printf("[%s: Server version.]\n", APPLICATION_NAME);
     ticker.attach_us(&tick_func1, 200 * 1000);
 #else
-    printf("Version on the mbed.\n");
+    printf("[%s: Local version.]\n", APPLICATION_NAME);
     ticker.attach_us(&tick_func2, 200 * 1000);
 #endif