diff options
Diffstat (limited to 'demos/ARM7-AT91SAM7X-WEB-GCC')
-rw-r--r-- | demos/ARM7-AT91SAM7X-WEB-GCC/main.c | 2 | ||||
-rw-r--r-- | demos/ARM7-AT91SAM7X-WEB-GCC/readme.txt | 8 | ||||
-rw-r--r-- | demos/ARM7-AT91SAM7X-WEB-GCC/web/cc-arch.h | 9 | ||||
-rw-r--r-- | demos/ARM7-AT91SAM7X-WEB-GCC/web/uip-conf.h | 9 | ||||
-rw-r--r-- | demos/ARM7-AT91SAM7X-WEB-GCC/web/webthread.c | 8 |
5 files changed, 25 insertions, 11 deletions
diff --git a/demos/ARM7-AT91SAM7X-WEB-GCC/main.c b/demos/ARM7-AT91SAM7X-WEB-GCC/main.c index 296ec7f67..bf23f3278 100644 --- a/demos/ARM7-AT91SAM7X-WEB-GCC/main.c +++ b/demos/ARM7-AT91SAM7X-WEB-GCC/main.c @@ -27,7 +27,7 @@ #include "web/webthread.h"
static WorkingArea(waWebThread, 512);
-static WorkingArea(waThread1, 128);
+static WorkingArea(waThread1, 64);
static msg_t Thread1(void *arg) {
diff --git a/demos/ARM7-AT91SAM7X-WEB-GCC/readme.txt b/demos/ARM7-AT91SAM7X-WEB-GCC/readme.txt index fc561fa4d..4dedc0658 100644 --- a/demos/ARM7-AT91SAM7X-WEB-GCC/readme.txt +++ b/demos/ARM7-AT91SAM7X-WEB-GCC/readme.txt @@ -8,7 +8,10 @@ The demo runs on an Olimex SAM7-EX256 board. ** The Demo **
-Work in progress, not finished yet.
+The demo currently just flashes the LCD background using a thread and serves
+HTTP requests at address 192.168.1.20 on port 80.
+The button SW1 prints an "Hello World!" string on COM1, the button SW2
+activates che ChibiOS/RT test suite, output on COM1.
** Build Procedure **
@@ -24,3 +27,6 @@ Also note that not all the files present in the Atmel library are distribuited with ChibiOS/RT, you can find the whole library on the Atmel web site:
http://www.atmel.com
+
+The uIP stack also has its own license, please read the info into the included
+uIP distribution files.
diff --git a/demos/ARM7-AT91SAM7X-WEB-GCC/web/cc-arch.h b/demos/ARM7-AT91SAM7X-WEB-GCC/web/cc-arch.h new file mode 100644 index 000000000..744cf56ef --- /dev/null +++ b/demos/ARM7-AT91SAM7X-WEB-GCC/web/cc-arch.h @@ -0,0 +1,9 @@ +#ifndef __CC_ARCH_H__
+#define __CC_ARCH_H__
+
+#define PACK_STRUCT_FIELD(x) x __attribute__((packed))
+#define PACK_STRUCT_STRUCT __attribute__((packed))
+#define PACK_STRUCT_BEGIN
+#define PACK_STRUCT_END
+
+#endif /* __CC_ARCH_H__ */
diff --git a/demos/ARM7-AT91SAM7X-WEB-GCC/web/uip-conf.h b/demos/ARM7-AT91SAM7X-WEB-GCC/web/uip-conf.h index 273b7cb71..b6a17c970 100644 --- a/demos/ARM7-AT91SAM7X-WEB-GCC/web/uip-conf.h +++ b/demos/ARM7-AT91SAM7X-WEB-GCC/web/uip-conf.h @@ -57,6 +57,8 @@ #include <stdint.h>
+#include <cc-arch.h> /* patched */
+
/**
* 8 bit datatype
*
@@ -86,13 +88,6 @@ typedef uint16_t u16_t; typedef unsigned short uip_stats_t;
/**
- * Modifier for packed structures.
- *
- * \hideinitializer
- */
-#define UIP_CONF_PACKED __attribute__((packed))
-
-/**
* Maximum number of TCP connections.
*
* \hideinitializer
diff --git a/demos/ARM7-AT91SAM7X-WEB-GCC/web/webthread.c b/demos/ARM7-AT91SAM7X-WEB-GCC/web/webthread.c index 2a45309f5..425a6366d 100644 --- a/demos/ARM7-AT91SAM7X-WEB-GCC/web/webthread.c +++ b/demos/ARM7-AT91SAM7X-WEB-GCC/web/webthread.c @@ -29,6 +29,10 @@ #include <timer.h>
#include <clock-arch.h>
+//#define IPADDR0 192
+//#define IPADDR1 168
+//#define IPADDR2 1
+//#define IPADDR3 20
#define IPADDR0 10
#define IPADDR1 151
#define IPADDR2 218
@@ -130,7 +134,7 @@ msg_t WebThread(void *p) { while (TRUE) {
uip_len = network_device_read();
if (uip_len > 0) {
- if (BUF->type == htons(UIP_ETHTYPE_IP)) {
+ if (BUF->type == HTONS(UIP_ETHTYPE_IP)) {
uip_arp_ipin();
uip_input();
if (uip_len > 0) {
@@ -138,7 +142,7 @@ msg_t WebThread(void *p) { network_device_send();
}
}
- else if (BUF->type == htons(UIP_ETHTYPE_ARP)) {
+ else if (BUF->type == HTONS(UIP_ETHTYPE_ARP)) {
uip_arp_arpin();
if (uip_len > 0)
network_device_send();
|