Skip to content

IAR support for ethernet library #948

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libraries/net/lwip/lwip-sys/arch/cc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion libraries/net/lwip/lwip-sys/arch/sys_arch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ class NTPClient
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!
Expand All @@ -86,7 +89,11 @@ class NTPClient
uint32_t rxTm_f;
uint32_t txTm_s;
uint32_t txTm_f;
#if defined (__ICCARM__)
};
#else
} __attribute__ ((packed));
#endif

UDPSocket m_sock;
};
Expand Down