Merge pull request #48 from remay/quiet-gcc-build
Tidy up gcc -Wall fixes Thanks @remay!
This commit is contained in:
commit
6a7436e5c7
8 changed files with 15 additions and 27 deletions
|
@ -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()
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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 ...
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue