Skip to content

Rollup PRs: simple fixes #10097

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 18 commits into from
Mar 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
67b706a
SAML21J18A: #endif without #if in analogout_api.c
janjongboom Mar 4, 2019
5839a8e
NUCLEO_H743ZI: Arduino A5 is mapped on ADC3_IN6
jeromecoutant Mar 4, 2019
71a1ed9
cellular: BC95 memory leak fix
Mar 7, 2019
d26dc88
TEST_APPS socket_app leaks memory when cannot initialize packetSizes
janjongboom Mar 7, 2019
eed2b39
Dead pointer usage in GenericSecurityManager
janjongboom Mar 7, 2019
49e9705
GigaDevice targets can return ninitialized variable in CAN driver
janjongboom Mar 7, 2019
ae45096
Fix undefined tr_debug for QUECTEL_BG96 cellular feature
sarahmarshy Mar 6, 2019
c5ad72b
Error check for reallocation memory fail
Mar 12, 2019
2af3a82
Removed PSoC6 SystemInit Workaround for ARM compiler
Mar 11, 2019
760ded6
Merge branch 'patch-5' of https://github.com/janjongboom/mbed-os into…
0xc0170 Mar 14, 2019
d6e81f5
Merge branch 'PR_H743_A5' of https://github.com/jeromecoutant/mbed in…
0xc0170 Mar 14, 2019
4df969f
Merge branch 'tr-debug-cell' of https://github.com/sarahmarshy/mbed-o…
0xc0170 Mar 14, 2019
d5eb98e
Merge branch 'cellular_BC95_leak_fix' of https://github.com/TeemuKult…
0xc0170 Mar 14, 2019
f032c8c
Merge branch 'patch-6' of https://github.com/janjongboom/mbed-os into…
0xc0170 Mar 14, 2019
8b94f3b
Merge branch 'patch-7' of https://github.com/janjongboom/mbed-os into…
0xc0170 Mar 14, 2019
2218efc
Merge branch 'gigabus_can' of https://github.com/janjongboom/mbed-os …
0xc0170 Mar 14, 2019
58e8916
Merge branch 'master' of https://github.com/ganesh-ramachandran/mbed-…
0xc0170 Mar 14, 2019
9b1b54d
Merge branch 'cy-mbed-os-5.12.0-ARM-compiler' of https://github.com/m…
0xc0170 Mar 14, 2019
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
1 change: 1 addition & 0 deletions TEST_APPS/device/socket_app/cmd_socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ static nsapi_size_or_error_t start_udp_receiver_thread(SInfo *info, int argc, ch
int *packetSizes = new (nothrow) int[PACKET_SIZE_ARRAY_LEN];
if (!packetSizes) {
cmd_printf("Allocation failed\r\n");
free(dataIn);
return CMDLINE_RETCODE_FAIL;
}
for (int i = 0; i < PACKET_SIZE_ARRAY_LEN; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,15 @@ TEST_F(TestAT_CellularNetwork, test_AT_CellularNetwork_get_registration_params)
EXPECT_TRUE(reg_params._status == CellularNetwork::RegistrationDenied);
EXPECT_TRUE(reg_params._act == CellularNetwork::RAT_EGPRS);
EXPECT_TRUE(reg_params._cell_id == -1);
EXPECT_TRUE(reg_params._lac == -1);

ATHandler_stub::read_string_index = 4;
ATHandler_stub::read_string_table[3] = "00C3";
ATHandler_stub::read_string_table[2] = "1234FFC1";//== cellid and in dec: 305463233
ATHandler_stub::read_string_table[1] = "00100100";
ATHandler_stub::read_string_table[0] = "01000111";
EXPECT_TRUE(NSAPI_ERROR_OK == cn.get_registration_params(CellularNetwork::C_EREG, reg_params));
EXPECT_TRUE(reg_params._lac == 0xc3);
EXPECT_TRUE(reg_params._cell_id == 305463233);
EXPECT_TRUE(reg_params._active_time == 240);
EXPECT_TRUE(reg_params._periodic_tau == 70 * 60 * 60);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -883,9 +883,8 @@ ble_error_t GenericSecurityManager<TPalSecurityManager, SigningMonitor>::init_si
const csrk_t *pcsrk = _db->get_local_csrk();
sign_count_t local_sign_counter = _db->get_local_sign_counter();

csrk_t csrk;
if (!pcsrk) {
csrk_t csrk;

ble_error_t ret = get_random_data(csrk.data(), csrk.size());
if (ret != BLE_ERROR_NONE) {
return ret;
Expand Down
1 change: 1 addition & 0 deletions features/cellular/framework/AT/AT_CellularNetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ void AT_CellularNetwork::read_reg_params_and_compare(RegistrationType type)
}
if (reg_params._cell_id != -1 && reg_params._cell_id != _reg_params._cell_id) {
_reg_params._cell_id = reg_params._cell_id;
_reg_params._lac = reg_params._lac;
data.status_data = reg_params._cell_id;
_connection_status_cb((nsapi_event_t)CellularCellIDChanged, (intptr_t)&data);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ nsapi_size_or_error_t QUECTEL_BC95_CellularStack::socket_sendto_impl(CellularSoc
_at.write_int(socket->id);
_at.write_int(size);
} else {
delete hexstr;
delete [] hexstr;
return NSAPI_ERROR_PARAMETER;
}

Expand All @@ -202,7 +202,7 @@ nsapi_size_or_error_t QUECTEL_BC95_CellularStack::socket_sendto_impl(CellularSoc
sent_len = _at.read_int();
_at.resp_stop();

delete hexstr;
delete [] hexstr;

if (_at.get_last_error() == NSAPI_ERROR_OK) {
return sent_len;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "QUECTEL_BG96_CellularStack.h"
#include "QUECTEL_BG96_CellularInformation.h"
#include "QUECTEL_BG96_CellularContext.h"
#include "CellularLog.h"

using namespace mbed;
using namespace events;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include "PeripheralPins.h"
#include "dac.h"

#if DEVICE_ANALOGOUT

extern uint8_t g_sys_init;

#define MAX_VAL_12BIT 0x0FFF /*12 Bit DAC for SAML21*/
Expand Down Expand Up @@ -119,4 +121,5 @@ const PinMap *analogout_pinmap()
{
return PinMap_DAC;
}
#endif

#endif // DEVICE_ANALOGOUT
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,6 @@ void mailbox_init(void);
*******************************************************************************/
void SystemInit(void)
{
/* Workaround to avoid twice SystemInit() call when ARMC5 compiler is used */
static uint32_t temp_var = 0;

if (temp_var == 0)
{
temp_var = 1;

Cy_PDL_Init(CY_DEVICE_CFG);

/* Restore FLL registers to the default state as they are not restored by the ROM code */
Expand Down Expand Up @@ -299,8 +292,6 @@ void SystemInit(void)
#else/* !defined(CY_IPC_DEFAULT_CFG_DISABLE) */
Cy_SemaIpcFlashInit();
#endif /* !defined(CY_IPC_DEFAULT_CFG_DISABLE) */

}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,11 +539,7 @@ extern "C" {
* \addtogroup group_system_config_system_functions
* \{
*/
#if defined(__ARMCC_VERSION)
extern void SystemInit(void) __attribute__((constructor));
#else
extern void SystemInit(void);
#endif /* (__ARMCC_VERSION) */
extern void SystemInit(void);

extern void SystemCoreClockUpdate(void);
/** \} group_system_config_system_functions */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,11 +539,7 @@ extern "C" {
* \addtogroup group_system_config_system_functions
* \{
*/
#if defined(__ARMCC_VERSION)
extern void SystemInit(void) __attribute__((constructor));
#else
extern void SystemInit(void);
#endif /* (__ARMCC_VERSION) */
extern void SystemInit(void);

extern void SystemCoreClockUpdate(void);
/** \} group_system_config_system_functions */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,11 +539,7 @@ extern "C" {
* \addtogroup group_system_config_system_functions
* \{
*/
#if defined(__ARMCC_VERSION)
extern void SystemInit(void) __attribute__((constructor));
#else
extern void SystemInit(void);
#endif /* (__ARMCC_VERSION) */
extern void SystemInit(void);

extern void SystemCoreClockUpdate(void);
/** \} group_system_config_system_functions */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,11 +539,7 @@ extern "C" {
* \addtogroup group_system_config_system_functions
* \{
*/
#if defined(__ARMCC_VERSION)
extern void SystemInit(void) __attribute__((constructor));
#else
extern void SystemInit(void);
#endif /* (__ARMCC_VERSION) */
extern void SystemInit(void);

extern void SystemCoreClockUpdate(void);
/** \} group_system_config_system_functions */
Expand Down
2 changes: 1 addition & 1 deletion targets/TARGET_GigaDevice/TARGET_GD32E10X/can_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ void can_free(can_t *obj)
*/
int can_frequency(can_t *obj, int hz)
{
int reval;
int reval = 0;

/* The maximum baud rate support to 1M */
if (hz <= 1000000) {
Expand Down
2 changes: 1 addition & 1 deletion targets/TARGET_GigaDevice/TARGET_GD32F30X/can_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ void can_free(can_t *obj)
*/
int can_frequency(can_t *obj, int hz)
{
int reval;
int reval = 0;

/* The maximum baud rate support to 1M */
if (hz <= 1000000) {
Expand Down
2 changes: 1 addition & 1 deletion targets/TARGET_GigaDevice/TARGET_GD32F4XX/can_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ void can_free(can_t *obj)
*/
int can_frequency(can_t *obj, int hz)
{
int reval;
int reval = 0;

/* The maximum baud rate support to 1M */
if (hz <= 1000000) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ MBED_WEAK const PinMap PinMap_ADC[] = {
{PF_8, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC3_INN3
{PF_8_ALT0, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC3_INP7
{PF_9, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC3_INP2
{PF_10, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC3_INN2
{PF_10_ALT0, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC3_INP6
{PF_10_ALT0, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC3_INN2
{PF_10, ADC_3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC3_INP6
{PF_11, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_INP2
{PF_12, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_INN2
{PF_12_ALT0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_INP6
Expand Down
8 changes: 8 additions & 0 deletions targets/TARGET_TOSHIBA/TARGET_TMPM46B/i2c_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ int i2c_write(i2c_t *obj, int address, const char *data, int length, int stop)

i2c_num = obj->index;
gI2C_TxData = (char *)calloc(length, sizeof(int8_t));
if (gI2C_TxData == NULL) {
error("Insufficient memory");
return 0;
}

for (i = 0; i < length; i++) {
gI2C_TxData[i] = data[i];
Expand Down Expand Up @@ -258,6 +262,10 @@ int i2c_byte_write(i2c_t *obj, int data)
byte_func = 1;
if (start_flag == 0 && send_byte == 0) {
gI2C_LTxData = (char *)realloc(gI2C_LTxData, counter++);
if (gI2C_LTxData == NULL) {
error("Insufficient memory");
return 0;
}
gI2C_LTxData[counter - 2] = data;
}

Expand Down