Skip to content

Commit cab660d

Browse files
authored
Merge pull request #4938 from deepikabhavnani/IAR_fixes
Update IAR to version 8
2 parents 3f2e986 + 6bd28ec commit cab660d

File tree

7 files changed

+21
-10
lines changed

7 files changed

+21
-10
lines changed

TESTS/mbed_drivers/stl_features/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <queue>
2727
#include <map>
2828
#include <math.h>
29+
#include <functional>
2930

3031
using namespace utest::v1;
3132

features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static bool set_CNMI(ATCmdParser *at)
110110
// New SMS indication configuration
111111
// set AT+CMTI=[mode, index] , 0 PDU mode, 1 text mode
112112
// Multiple URCs for SMS, i.e., CMT, CMTI, UCMT, CBMI, CDSI as DTE could be following any of these SMS formats
113-
bool success = at->send("AT+CNMI=2,"CTX) && at->recv("OK");
113+
bool success = at->send("AT+CNMI=2," CTX) && at->recv("OK");
114114
return success;
115115
}
116116

@@ -141,7 +141,7 @@ static void CMT_URC(ATCmdParser *at)
141141

142142
static bool set_atd(ATCmdParser *at)
143143
{
144-
bool success = at->send("ATD*99***"CTX"#") && at->recv("CONNECT");
144+
bool success = at->send("ATD*99***" CTX"#") && at->recv("CONNECT");
145145

146146
return success;
147147
}
@@ -469,7 +469,7 @@ nsapi_error_t PPPCellularInterface::setup_context_and_credentials()
469469
#endif
470470
success = _at->send("AT"
471471
"+FCLASS=0;" // set to connection (ATD) to data mode
472-
"+CGDCONT="CTX",\"%s\",\"%s%s\"",
472+
"+CGDCONT=" CTX",\"%s\",\"%s%s\"",
473473
pdp_type, auth, _apn
474474
)
475475
&& _at->recv("OK");

features/storage/FEATURE_STORAGE/cfstore/configuration-store/configuration_store.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ typedef struct _ARM_CFSTORE_STATUS {
189189
}while(0)
190190
#endif
191191

192-
#if defined __MBED__ && defined TOOLCHAIN_IAR
192+
#if defined __MBED__ && defined __ICCARM__
193193
/** @brief Helper macro to swap 2 handles, which is useful for the Find() idiom. */
194194
/* note, memory barriers may be required in the following implementation */
195195
#define CFSTORE_HANDLE_SWAP(__a_HaNdLe, __b_HaNdLe) \

features/storage/FEATURE_STORAGE/storage-volume-manager/storage-volume-manager/storage_volume_manager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* FlashJournal_t. The caller will only allocate a FlashJournal_t and expect the
3636
* Sequential Strategy to reuse that space for a SequentialFlashJournal_t.
3737
*/
38-
#ifndef TOOLCHAIN_IAR
38+
#ifndef __ICCARM__
3939
typedef char AssertStorageVolumeManagerMaxVolumesIsSane[(((MAX_VOLUMES) > 0) && ((MAX_VOLUMES) <= 8)) ? 0:-1];
4040
#endif
4141

platform/mbed_retarget.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ std::FILE *mbed_fdopen(FileHandle *fh, const char *mode)
843843
}
844844

845845
int mbed_getc(std::FILE *_file){
846-
#if defined (__ICCARM__)
846+
#if defined(__IAR_SYSTEMS_ICC__ ) && (__VER__ < 8000000)
847847
/*This is only valid for unbuffered streams*/
848848
int res = std::fgetc(_file);
849849
if (res>=0){
@@ -858,7 +858,7 @@ int mbed_getc(std::FILE *_file){
858858
}
859859

860860
char* mbed_gets(char*s, int size, std::FILE *_file){
861-
#if defined (__ICCARM__)
861+
#if defined(__IAR_SYSTEMS_ICC__ ) && (__VER__ < 8000000)
862862
/*This is only valid for unbuffered streams*/
863863
char *str = fgets(s,size,_file);
864864
if (str!=NULL){
@@ -884,6 +884,9 @@ extern "C" WEAK void __iar_file_Mtxinit(__iar_Rmtx *mutex) {}
884884
extern "C" WEAK void __iar_file_Mtxdst(__iar_Rmtx *mutex) {}
885885
extern "C" WEAK void __iar_file_Mtxlock(__iar_Rmtx *mutex) {}
886886
extern "C" WEAK void __iar_file_Mtxunlock(__iar_Rmtx *mutex) {}
887+
#if defined(__IAR_SYSTEMS_ICC__ ) && (__VER__ >= 8000000)
888+
extern "C" WEAK void *__aeabi_read_tp (void) { return NULL ;}
889+
#endif
887890
#elif defined(__CC_ARM)
888891
// Do nothing
889892
#elif defined (__GNUC__)

rtos/TARGET_CORTEX/mbed_boot.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@
168168
#include "cmsis_os2.h"
169169
#include "mbed_toolchain.h"
170170
#include "mbed_error.h"
171-
171+
#if defined(__IAR_SYSTEMS_ICC__ ) && (__VER__ >= 8000000)
172+
#include <DLib_Threads.h>
173+
#endif
172174
/* Heap limits - only used if set */
173175
extern unsigned char *mbed_heap_start;
174176
extern uint32_t mbed_heap_size;
@@ -552,7 +554,7 @@ void __rtos_env_unlock( struct _reent *_r )
552554

553555
#endif
554556

555-
#if defined(TOOLCHAIN_IAR) /******************** IAR ********************/
557+
#if defined(__ICCARM__) /******************** IAR ********************/
556558

557559
extern void* __vector_table;
558560
extern int __low_level_init(void);
@@ -574,9 +576,14 @@ void pre_main(void)
574576
singleton_mutex_attr.cb_mem = &singleton_mutex_obj;
575577
singleton_mutex_id = osMutexNew(&singleton_mutex_attr);
576578

579+
#if defined(__IAR_SYSTEMS_ICC__ ) && (__VER__ >= 8000000)
580+
__iar_Initlocks();
581+
#endif
582+
577583
if (low_level_init_needed) {
578584
__iar_dynamic_initialization();
579585
}
586+
580587
mbed_main();
581588
main();
582589
}

targets/TARGET_Realtek/TARGET_AMEBA/rtw_emac.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ emac_interface_t *wlan_emac_init_interface()
217217
{
218218

219219
if (_emac == NULL) {
220-
_emac = new emac_interface_t();
220+
_emac = (emac_interface_t*) malloc(sizeof(emac_interface_t));
221221
if (_emac == NULL) {//new emac_interface_t fail
222222
printf("emac initialization failed\r\n");
223223
return NULL;

0 commit comments

Comments
 (0)