diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | accel.c | 6 | ||||
-rw-r--r-- | accel.h | 6 | ||||
-rw-r--r-- | common.h | 2 | ||||
-rw-r--r-- | gyro.c | 6 | ||||
-rw-r--r-- | gyro.h | 6 | ||||
-rw-r--r-- | i2c.c | 3 | ||||
-rw-r--r-- | speaker.c | 2 | ||||
-rw-r--r-- | uart.c | 6 |
9 files changed, 23 insertions, 16 deletions
@@ -1,5 +1,5 @@ MCU = atmega88 -CFLAGS=-Os +CFLAGS=-Os -Wall -Wextra all: sanduhr.hex @@ -180,15 +180,15 @@ bool accelProcess () { return false; } -const int8_t accelGetZ () { +int8_t accelGetZ () { return zval; } -const uint8_t accelGetShakeCount () { +uint8_t accelGetShakeCount () { return shakeCount; } -const horizon accelGetHorizon () { +horizon accelGetHorizon () { return horizonSign; } @@ -9,9 +9,9 @@ typedef enum {HORIZON_NONE, HORIZON_POS, HORIZON_NEG} horizon; void accelInit (); void accelStart (); bool accelProcess (); -const int8_t accelGetZ (); -const uint8_t accelGetShakeCount (); -const horizon accelGetHorizon (); +int8_t accelGetZ (); +uint8_t accelGetShakeCount (); +horizon accelGetHorizon (); #endif /* ACCEL_H */ @@ -9,5 +9,7 @@ while (cond) { sleep_cpu (); } \ sleep_disable (); +#define __unused__ __attribute__ ((unused)) + #endif /* COMMON_H */ @@ -111,7 +111,7 @@ bool gyroProcess () { return false; } -const int32_t gyroGetZAccum () { +int32_t gyroGetZAccum () { return zaccum; } @@ -119,11 +119,11 @@ void gyroResetZAccum () { zaccum = 0; } -volatile const int16_t gyroGetZRaw () { +int16_t gyroGetZRaw () { return zval; } -const int8_t gyroGetZTicks () { +int8_t gyroGetZTicks () { return zticks; } @@ -8,9 +8,9 @@ void gyroInit (); void gyroStart (); bool gyroProcess (); void gyroResetAccum (); -const int32_t gyroGetZAccum (); -volatile const int16_t gyroGetZRaw (); -const int8_t gyroGetZTicks (); +int32_t gyroGetZAccum (); +int16_t gyroGetZRaw (); +int8_t gyroGetZTicks (); #endif /* GYROSCOPE_H */ @@ -30,9 +30,12 @@ static void twFlushContRaw () { TWCR = (TWCR & ~((1 << TWSTA) | (1 << TWSTO))) | (1 << TWIE) | (1 << TWINT) | (1 << TWEN) | (1 << TWEA); } +#if 0 +/* unused */ static void twWaitRaw () { while (!(TWCR & (1 << TWINT))); } +#endif static bool twWriteRaw (const uint8_t data) { TWDR = data; @@ -37,7 +37,7 @@ void speakerStart () { /* enable overflow interrupt */ TIMSK2 = (1 << TOIE2); /* io clock with 1024 prescaler */ - TCCR2B = (TCCR2B & ~((1 << CS21)) | (1 << CS22) | (1 << CS20)); + TCCR2B = ((TCCR2B & ~(1 << CS21)) | (1 << CS22) | (1 << CS20)); } void speakerStop () { @@ -13,7 +13,7 @@ static void uartSend (unsigned char data) { UDR0 = data; } -static int uartPutc (char c, FILE *stream) { +static int uartPutc (char c, FILE *stream __unused__) { if (c == '\n') { uartSend ('\r'); } @@ -48,10 +48,12 @@ void uartInit () { stdout = &mystdout; } +#if 0 +/* unused */ static unsigned char uartReceive () { /* Wait for data to be received */ while ( !(UCSR0A & (1<<RXC0)) ); /* Get and return received data from buffer */ return UDR0; } - +#endif |