Merge pull request #948 from GustavWi/master

IAR support for ethernet library
pull/893/merge
Martin Kojtal 2015-03-06 08:48:13 +01:00
commit ed57ce8748
3 changed files with 10 additions and 3 deletions

View File

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

View File

@ -427,7 +427,7 @@ sys_thread_t sys_thread_new(const char *pcName,
t->def.tpriority = (osPriority)priority;
t->def.stacksize = stacksize;
#ifndef __MBED_CMSIS_RTOS_CA9
t->def.stack_pointer = (unsigned char*)malloc(stacksize);
t->def.stack_pointer = (uint32_t*)malloc(stacksize);
if (t->def.stack_pointer == NULL) {
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
private:
#if defined (__ICCARM__)
#pragma pack()
#endif
struct NTPPacket //See RFC 4330 for Simple NTP
{
//WARN: We are in LE! Network is BE!
@ -86,7 +89,11 @@ private:
uint32_t rxTm_f;
uint32_t txTm_s;
uint32_t txTm_f;
#if defined (__ICCARM__)
};
#else
} __attribute__ ((packed));
#endif
UDPSocket m_sock;
};