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:16:48 2010 +0000
Parent:
3:4d3eefb95408
Child:
5:faf2bdb5bc84
Commit message:
Updated the target class.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mylib/FirmwareUpdater.lib Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Nov 03 22:06:40 2010 +0000
+++ b/main.cpp	Fri Nov 05 12:16:48 2010 +0000
@@ -28,8 +28,12 @@
 #include "FirmwareUpdater.h"
 #include "EthernetNetIf.h"
 
+#define ON_A_SERVER 0
+
 EthernetNetIf eth;
 FirmwareUpdater fwup("http://mbed.org/media/uploads/shintamainjp/", "firm", true);
+BusOut led(LED4, LED3, LED2, LED1);
+Ticker ticker;
 
 // [On a server]
 //  1. firm.txt : firmware version file.
@@ -39,19 +43,32 @@
 //  1. firm.txt : firmware version file.
 //  2. firm.bin : firmware binary file.
 
+/**
+ * LED function Type-1.
+ */
+void tick_func1() {
+    led = led + 1;
+}
+
+/**
+ * LED function Type-2.
+ */
+void tick_func2() {
+    led = led - 1;
+}
+
+/**
+ * Entry point.
+ */
 int main() {
     eth.setup();
 
-#if 1
-    /*
-     * Please put this version on your mbed local storage.
-     */
-    printf("This is local version.\n");
+#if ON_A_SERVER
+    printf("Version on the server.\n");
+    ticker.attach_us(&tick_func1, 200 * 1000);
 #else
-    /*
-     * Please put this version on a server for debugging purpose.
-     */
-    printf("This is server version.\n");
+    printf("Version on the mbed.\n");
+    ticker.attach_us(&tick_func2, 200 * 1000);
 #endif
 
     const int a = fwup.exist();
--- a/mylib/FirmwareUpdater.lib	Wed Nov 03 22:06:40 2010 +0000
+++ b/mylib/FirmwareUpdater.lib	Fri Nov 05 12:16:48 2010 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/shintamainjp/code/FirmwareUpdater/#a9a32355af69
+http://mbed.org/users/shintamainjp/code/FirmwareUpdater/#851bd91fa0ae