Tidy up gcc -Wall fixes.

This commit is contained in:
Robert May 2015-11-18 23:13:57 +00:00
parent de681e68c3
commit 051575d911
7 changed files with 15 additions and 29 deletions

View File

@ -31,11 +31,8 @@ microbit_reset()
/**
* Callback when a BLE GATT disconnect occurs.
*/
void bleDisconnectionCallback(Gap::Handle_t handle, Gap::DisconnectionReason_t reason)
void bleDisconnectionCallback(Gap::Handle_t, Gap::DisconnectionReason_t)
{
(void) handle; /* -Wunused-param */
(void) reason; /* -Wunused-param */
uBit.ble->startAdvertising();
}

View File

@ -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();
}

View File

@ -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 ...

View File

@ -65,9 +65,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();

View File

@ -49,9 +49,8 @@ MicroBitDFUService::MicroBitDFUService(BLEDevice &_ble) :
ble.gattServer().onDataWritten(this, &MicroBitDFUService::onDataWritten);
}
void MicroBitDFUService::onButtonA(MicroBitEvent e)
void MicroBitDFUService::onButtonA(MicroBitEvent)
{
(void) e; /* -Wunused-parameter */
if (flashCodeRequested)
{
releaseFlashCode();
@ -62,9 +61,8 @@ void MicroBitDFUService::onButtonA(MicroBitEvent e)
}
}
void MicroBitDFUService::onButtonB(MicroBitEvent e)
void MicroBitDFUService::onButtonB(MicroBitEvent)
{
(void) e; /* -Wunused-parameter */
uBit.display.scroll("VERSION: TODO");
showNameHistogram();
}

View File

@ -67,10 +67,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();
@ -90,10 +88,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);

View File

@ -45,10 +45,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();