IAR support for ethernet library

pull/948/head
GustavWi 2015-03-04 13:06:27 +01:00
parent 83f6c17514
commit 86c6d635d0
3 changed files with 13 additions and 2 deletions

View File

@ -71,8 +71,8 @@ typedef uintptr_t mem_ptr_t;
#define PACK_STRUCT_STRUCT #define PACK_STRUCT_STRUCT
#define PACK_STRUCT_END #define PACK_STRUCT_END
#define PACK_STRUCT_FIELD(fld) fld #define PACK_STRUCT_FIELD(fld) fld
// #define PACK_STRUCT_USE_INCLUDES #define IAR_STR(a) #a
#error NEEDS ALIGNED // FIXME TBD #define ALIGNED(n) _Pragma(IAR_STR(data_alignment= ## n ##))
#else #else
/* GCC tools (CodeSourcery) */ /* GCC tools (CodeSourcery) */
#define PACK_STRUCT_BEGIN #define PACK_STRUCT_BEGIN

View File

@ -427,7 +427,11 @@ sys_thread_t sys_thread_new(const char *pcName,
t->def.tpriority = (osPriority)priority; t->def.tpriority = (osPriority)priority;
t->def.stacksize = stacksize; t->def.stacksize = stacksize;
#ifndef __MBED_CMSIS_RTOS_CA9 #ifndef __MBED_CMSIS_RTOS_CA9
#if defined (__ICCARM__)
t->def.stack_pointer = (uint32_t*)malloc(stacksize);
#else
t->def.stack_pointer = (unsigned char*)malloc(stacksize); t->def.stack_pointer = (unsigned char*)malloc(stacksize);
#endif
if (t->def.stack_pointer == NULL) { if (t->def.stack_pointer == NULL) {
error("Error allocating the stack memory"); error("Error allocating the stack memory");
} }

View File

@ -61,6 +61,9 @@ public:
NTPResult setTime(const char* host, uint16_t port = NTP_DEFAULT_PORT, uint32_t timeout = NTP_DEFAULT_TIMEOUT); //Blocking NTPResult setTime(const char* host, uint16_t port = NTP_DEFAULT_PORT, uint32_t timeout = NTP_DEFAULT_TIMEOUT); //Blocking
private: private:
#if defined (__ICCARM__)
#pragma pack()
#endif
struct NTPPacket //See RFC 4330 for Simple NTP struct NTPPacket //See RFC 4330 for Simple NTP
{ {
//WARN: We are in LE! Network is BE! //WARN: We are in LE! Network is BE!
@ -86,7 +89,11 @@ private:
uint32_t rxTm_f; uint32_t rxTm_f;
uint32_t txTm_s; uint32_t txTm_s;
uint32_t txTm_f; uint32_t txTm_f;
#if defined (__ICCARM__)
};
#else
} __attribute__ ((packed)); } __attribute__ ((packed));
#endif
UDPSocket m_sock; UDPSocket m_sock;
}; };