File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed
tests/net/protocols/NTPClient_HelloWorld/NTPClient Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -71,8 +71,8 @@ typedef uintptr_t mem_ptr_t;
71
71
#define PACK_STRUCT_STRUCT
72
72
#define PACK_STRUCT_END
73
73
#define PACK_STRUCT_FIELD (fld ) fld
74
- // #define PACK_STRUCT_USE_INCLUDES
75
- #error NEEDS ALIGNED // FIXME TBD
74
+ #define IAR_STR ( a ) #a
75
+ #define ALIGNED ( n ) _Pragma(IAR_STR(data_alignment= ## n ##))
76
76
#else
77
77
/* GCC tools (CodeSourcery) */
78
78
#define PACK_STRUCT_BEGIN
Original file line number Diff line number Diff line change @@ -427,7 +427,11 @@ sys_thread_t sys_thread_new(const char *pcName,
427
427
t -> def .tpriority = (osPriority )priority ;
428
428
t -> def .stacksize = stacksize ;
429
429
#ifndef __MBED_CMSIS_RTOS_CA9
430
+ #if defined (__ICCARM__ )
431
+ t -> def .stack_pointer = (uint32_t * )malloc (stacksize );
432
+ #else
430
433
t -> def .stack_pointer = (unsigned char * )malloc (stacksize );
434
+ #endif
431
435
if (t -> def .stack_pointer == NULL ) {
432
436
error ("Error allocating the stack memory" );
433
437
}
Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ class NTPClient
61
61
NTPResult setTime (const char * host, uint16_t port = NTP_DEFAULT_PORT, uint32_t timeout = NTP_DEFAULT_TIMEOUT); // Blocking
62
62
63
63
private:
64
+ #if defined (__ICCARM__)
65
+ #pragma pack()
66
+ #endif
64
67
struct NTPPacket // See RFC 4330 for Simple NTP
65
68
{
66
69
// WARN: We are in LE! Network is BE!
@@ -86,7 +89,11 @@ class NTPClient
86
89
uint32_t rxTm_f;
87
90
uint32_t txTm_s;
88
91
uint32_t txTm_f;
92
+ #if defined (__ICCARM__)
93
+ };
94
+ #else
89
95
} __attribute__ ((packed));
96
+ #endif
90
97
91
98
UDPSocket m_sock;
92
99
};
You can’t perform that action at this time.
0 commit comments