diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 861ee52..615e6fd 100755 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -85,7 +85,9 @@ target_link_libraries(microbit-dal ) if(CMAKE_COMPILER_IS_GNUCC) + message("suppressing ALL warnings from mbed-classic, ble, ble-nrf51822 & nrf51-sdk") target_compile_options(mbed-classic PRIVATE "-w") target_compile_options(ble PRIVATE "-w") target_compile_options(ble-nrf51822 PRIVATE "-w") + target_compile_options(nrf51-sdk PRIVATE "-w") endif() diff --git a/source/MicroBit.cpp b/source/MicroBit.cpp index 55bb5f1..d573628 100644 --- a/source/MicroBit.cpp +++ b/source/MicroBit.cpp @@ -60,10 +60,8 @@ microbit_reset() NVIC_SystemReset(); } -void bleDisconnectionCallback(const Gap::DisconnectionCallbackParams_t *reason) +void bleDisconnectionCallback(const Gap::DisconnectionCallbackParams_t *) { - (void) reason; /* -Wunused-param */ - uBit.ble->startAdvertising(); } diff --git a/source/MicroBitFiber.cpp b/source/MicroBitFiber.cpp index 461da33..26816de 100644 --- a/source/MicroBitFiber.cpp +++ b/source/MicroBitFiber.cpp @@ -533,10 +533,8 @@ Fiber *create_fiber(void (*entry_fn)(void *), void *param, void (*completion_fn) * Default exit point for all parameterised fibers. * Any fiber reaching the end of its entry function will return here for recycling. */ -void release_fiber(void * param) +void release_fiber(void *) { - (void)param; /* -Wunused-parameter */ - release_fiber(); } diff --git a/source/MicroBitThermometer.cpp b/source/MicroBitThermometer.cpp index 2619f69..e730289 100644 --- a/source/MicroBitThermometer.cpp +++ b/source/MicroBitThermometer.cpp @@ -1,13 +1,13 @@ #include "MicroBit.h" /** - * Turn off warnings under gcc -Wall - * We turn off unused-function for the entire compilation - * unit as the compiler can't tell if a function is - * unused until the end of the unit. The macro - * expansion for SVCALL() in nrf_soc.h and nrf_srv.h - * tries to leave unused-function turned off, but - * It might be leaner to add + * Turn off warnings under gcc -Wall. We turn off unused-function for the + * entire compilation unit as the compiler can't tell if a function is + * unused until the end of the unit. The macro expansion for SVCALL() + * in nrf_soc.h and nrf_srv.h tries to leave unused-function turned off, + * but we restore the state from before the include with our diagnostics + * pop. + * It might be cleaner to add * #pragram GCC system header * as the first line of nrf_soc.h, but that's a different * module ... diff --git a/source/ble-services/MicroBitAccelerometerService.cpp b/source/ble-services/MicroBitAccelerometerService.cpp index f4143ec..b293ea5 100644 --- a/source/ble-services/MicroBitAccelerometerService.cpp +++ b/source/ble-services/MicroBitAccelerometerService.cpp @@ -69,10 +69,8 @@ void MicroBitAccelerometerService::onDataWritten(const GattWriteCallbackParams * /** * Accelerometer update callback */ -void MicroBitAccelerometerService::accelerometerUpdate(MicroBitEvent e) +void MicroBitAccelerometerService::accelerometerUpdate(MicroBitEvent) { - (void) e; /* -Wunused-parameter */ - if (ble.getGapState().connected) { accelerometerDataCharacteristicBuffer[0] = uBit.accelerometer.getX(); diff --git a/source/ble-services/MicroBitDFUService.cpp b/source/ble-services/MicroBitDFUService.cpp index 028e1b9..0dd2272 100644 --- a/source/ble-services/MicroBitDFUService.cpp +++ b/source/ble-services/MicroBitDFUService.cpp @@ -63,8 +63,6 @@ MicroBitDFUService::MicroBitDFUService(BLEDevice &_ble) : ble.gattServer().onDataWritten(this, &MicroBitDFUService::onDataWritten); } - - /** * Callback. Invoked when any of our attributes are written via BLE. */ diff --git a/source/ble-services/MicroBitMagnetometerService.cpp b/source/ble-services/MicroBitMagnetometerService.cpp index a688ef6..8922781 100644 --- a/source/ble-services/MicroBitMagnetometerService.cpp +++ b/source/ble-services/MicroBitMagnetometerService.cpp @@ -72,10 +72,8 @@ void MicroBitMagnetometerService::onDataWritten(const GattWriteCallbackParams *p /** * Magnetometer update callback */ -void MicroBitMagnetometerService::magnetometerUpdate(MicroBitEvent e) +void MicroBitMagnetometerService::magnetometerUpdate(MicroBitEvent) { - (void) e; /* -Wunused-parameter */ - if (ble.getGapState().connected) { magnetometerDataCharacteristicBuffer[0] = uBit.compass.getX(); @@ -99,10 +97,8 @@ void MicroBitMagnetometerService::magnetometerUpdate(MicroBitEvent e) * Reconfiguring the magnetometer can to a REALLY long time (sometimes even seconds to complete) * So we do this in the background when necessary, through this event handler. */ -void MicroBitMagnetometerService::samplePeriodUpdateNeeded(MicroBitEvent e) +void MicroBitMagnetometerService::samplePeriodUpdateNeeded(MicroBitEvent) { - (void) e; /* -Wunused-parameter */ - // Reconfigure the compass. This might take a while... uBit.compass.setPeriod(magnetometerPeriodCharacteristicBuffer); diff --git a/source/ble-services/MicroBitTemperatureService.cpp b/source/ble-services/MicroBitTemperatureService.cpp index 9c47706..a4440f6 100644 --- a/source/ble-services/MicroBitTemperatureService.cpp +++ b/source/ble-services/MicroBitTemperatureService.cpp @@ -49,10 +49,8 @@ MicroBitTemperatureService::MicroBitTemperatureService(BLEDevice &_ble) : /** * Temperature update callback */ -void MicroBitTemperatureService::temperatureUpdate(MicroBitEvent e) +void MicroBitTemperatureService::temperatureUpdate(MicroBitEvent) { - (void) e; /* -Wunused-parameter */ - if (ble.getGapState().connected) { temperatureDataCharacteristicBuffer = uBit.thermometer.getTemperature();