Fix various GCC compilation issues.

This commit is contained in:
Andrew Fernandes 2015-06-16 15:08:32 -04:00
parent d3889dfb7e
commit fbfc6d16f3
5 changed files with 14 additions and 16 deletions

View file

@ -80,11 +80,9 @@ static inline void debugger_breakpoint(void)
// Assert Helper
//--------------------------------------------------------------------+
//#ifndef _TEST_
// #define ASSERT_MESSAGE(format, ...)\
// _PRINTF("Assert at %s: %s: %d: " format "\n", __BASE_FILE__, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
// #define ASSERT_MESSAGE(format, ...) _PRINTF("Assert at %s: %s: %d: " format "\n", __BASE_FILE__, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
//#else
// #define ASSERT_MESSAGE(format, ...)\
// _PRINTF("%d:note: Assert " format "\n", __LINE__, __VA_ARGS__)
// #define ASSERT_MESSAGE(format, ...) _PRINTF("%d:note: Assert " format "\n", __LINE__, __VA_ARGS__)
//#endif
#if CFG_DEBUG == 3

View file

@ -295,6 +295,8 @@ ble_error_t nRF51Gap::disconnect(DisconnectionReason_t reason)
case CONN_INTERVAL_UNACCEPTABLE:
code = BLE_HCI_CONN_INTERVAL_UNACCEPTABLE;
break;
default:
break;
}
/* Disconnect if we are connected to a central device */

View file

@ -116,14 +116,11 @@ public:
}
virtual ble_error_t write(GattClient::WriteOp_t cmd, Gap::Handle_t connHandle, GattAttribute::Handle_t attributeHandle, size_t length, const uint8_t *value) const {
ble_gattc_write_params_t writeParams = {
.write_op = cmd,
// .flags = 0,
.handle = attributeHandle,
.offset = 0,
.len = length,
.p_value = const_cast<uint8_t *>(value),
};
ble_gattc_write_params_t writeParams = { };
writeParams.write_op = cmd;
writeParams.handle = attributeHandle;
writeParams.len = length;
writeParams.p_value = const_cast<uint8_t *>(value);
uint32_t rc = sd_ble_gattc_write(connHandle, &writeParams);
if (rc == NRF_SUCCESS) {

View file

@ -227,10 +227,9 @@ nRF51ServiceDiscovery::CharUUIDDiscoveryQueue::triggerFirst(void)
.uuid = BLE_UUID_CHARACTERISTIC,
.type = BLE_UUID_TYPE_BLE,
};
ble_gattc_handle_range_t handleRange = {
.start_handle = parentDiscoveryObject->characteristics[charIndex].getDeclHandle(),
.end_handle = parentDiscoveryObject->characteristics[charIndex].getDeclHandle() + 1,
};
ble_gattc_handle_range_t handleRange = { };
handleRange.start_handle = parentDiscoveryObject->characteristics[charIndex].getDeclHandle();
handleRange.end_handle = parentDiscoveryObject->characteristics[charIndex].getDeclHandle() + 1;
if (sd_ble_gattc_char_value_by_uuid_read(parentDiscoveryObject->connHandle, &uuid, &handleRange) == NRF_SUCCESS) {
return;
}

View file

@ -88,6 +88,8 @@ static void bootloader_util_reset(uint32_t start_addr)
asm(
".equ MASK_ONES, 0xFFFFFFFF\n\t" /* Ones, to be loaded into register as default value before reset. */
".equ MASK_ZEROS, 0x00000000\n\t" /* Zeros, to be loaded into register as default value before reset. */
".equ xPSR_RESET, 0x21000000\n\t" /* Default value of xPSR after System Reset. */
".equ EXC_RETURN_CMD, 0xFFFFFFF9\n\t" /* EXC_RETURN for ARM Cortex. When loaded to PC the current interrupt service routine (handler mode) willl exit and the stack will be popped. Execution will continue in thread mode. */
"LDR r5, [r0] \n\t" /* Get App initial MSP for bootloader. */
"MSR MSP, r5 \n\t" /* Set the main stack pointer to the applications MSP. */