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: mbed FirmwareUpdater EthernetNetIf
Diff: main.cpp
- Revision:
- 4:e742ea7a3d20
- Parent:
- 2:2e46d5aef428
- Child:
- 5:faf2bdb5bc84
diff -r 4d3eefb95408 -r e742ea7a3d20 main.cpp
--- 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();