]> git.droids-corp.org - protos/imu.git/commitdiff
fix compilation errors due to undefined variables
authorOlivier Matz <zer0@droids-corp.org>
Thu, 26 Jun 2014 18:31:33 +0000 (20:31 +0200)
committerOlivier Matz <zer0@droids-corp.org>
Thu, 26 Jun 2014 18:31:33 +0000 (20:31 +0200)
fat.c
i2cm_sw.c
imu.c
sd_main.c
sd_raw.c
sd_raw.h

diff --git a/fat.c b/fat.c
index 367d48965248090d93c9910d6733784b6392dc6f..df579ce4ddc3a219f4f085864a1e6a07fb45ccc6 100644 (file)
--- a/fat.c
+++ b/fat.c
@@ -814,6 +814,9 @@ uint8_t fat_clear_cluster(const struct fat_fs_struct* fs, cluster_t cluster_num)
  */
 uintptr_t fat_clear_cluster_callback(uint8_t* buffer, offset_t offset, void* p)
 {
+       (void)buffer;
+       (void)offset;
+       (void)p;
     return 16;
 }
 #endif
@@ -2518,6 +2521,8 @@ uint8_t fat_get_fs_free_16_callback(uint8_t* buffer, offset_t offset, void* p)
     struct fat_usage_count_callback_arg* count_arg = (struct fat_usage_count_callback_arg*) p;
     uintptr_t buffer_size = count_arg->buffer_size;
 
+    (void)offset;
+
     for(uintptr_t i = 0; i < buffer_size; i += 2, buffer += 2)
     {
        uint16_t cluster = read16(buffer);
@@ -2538,6 +2543,8 @@ uint8_t fat_get_fs_free_32_callback(uint8_t* buffer, offset_t offset, void* p)
     struct fat_usage_count_callback_arg* count_arg = (struct fat_usage_count_callback_arg*) p;
     uintptr_t buffer_size = count_arg->buffer_size;
 
+    (void)offset;
+
     for(uintptr_t i = 0; i < buffer_size; i += 4, buffer += 4)
     {
        uint32_t cluster = read32(buffer);
index 78f562d1ce2935d6da0a8e80ff1a43ad03a82d0f..92f23216548bfd54df1305be968e2bac4c347d51 100644 (file)
--- a/i2cm_sw.c
+++ b/i2cm_sw.c
@@ -283,11 +283,13 @@ uint8_t i2cm_receive_byte(uint8_t last)
 
 
 
-uint8_t i2c_send(uint8_t addr, uint8_t* data, uint8_t len, uint8_t dummy)
+uint8_t i2c_send(uint8_t addr, uint8_t* data, uint8_t len, uint8_t ctrl)
 {
        uint8_t i;
        uint8_t err = 0;
 
+       (void)ctrl; /* ignored */
+
        err = i2cm_send_start((addr<<1) | 0);
        if (err)
                return err;
@@ -305,11 +307,13 @@ uint8_t i2c_send(uint8_t addr, uint8_t* data, uint8_t len, uint8_t dummy)
 
 uint8_t i2c_buf[0x20];
 
-uint8_t i2c_recv(uint8_t addr, uint8_t len, uint8_t dummy)
+uint8_t i2c_recv(uint8_t addr, uint8_t len, uint8_t ctrl)
 {
        uint8_t i;
        uint8_t err = 0;
 
+       (void)ctrl; /* ignored */
+
        err = i2cm_send_start((addr<<1) | 1);
        if (err)
                return err;
diff --git a/imu.c b/imu.c
index 745df114e98c6620b3f60ed0101631f5e09f6844..efaba62a906d061f7daa12b72f0ce6299149e2a0 100644 (file)
--- a/imu.c
+++ b/imu.c
@@ -40,11 +40,15 @@ int mag_z;
 
 
 void i2c_recvevent(uint8_t * buf, int8_t size)
+void i2c_recvevent(uint8_t *buf, int8_t size)
 {
+       (void)buf;
+       (void)size;
 }
 
 void i2c_sendevent(int8_t size)
 {
+       (void)size;
 }
 
 
@@ -65,6 +69,8 @@ uint16_t counter;
 
 void do_led_blink(void *dummy)
 {
+       (void)dummy;
+
 #if 1 /* simple blink */
        LED1_TOGGLE();
 #endif
index 82bb8ad9061718958bad8dbc55844436fc2d2c01..d2ee6c5afd8ce7641d68474ca59765c252f382c8 100644 (file)
--- a/sd_main.c
+++ b/sd_main.c
@@ -603,6 +603,8 @@ uint32_t strtolong(const char* str)
 
 uint8_t find_file_in_dir(struct fat_fs_struct* fs, struct fat_dir_struct* dd, const char* name, struct fat_dir_entry_struct* dir_entry)
 {
+       (void)fs;
+
     while(fat_read_dir(dd, dir_entry))
     {
        if(strcmp(dir_entry->long_name, name) == 0)
index 8c830a3a2ccbfe1b6f7e5c7cb1e93c31eb7ccc15..f33184e2023be45dfdba28b33938244a55891da6 100644 (file)
--- a/sd_raw.c
+++ b/sd_raw.c
@@ -9,9 +9,12 @@
  */
 
 #include <string.h>
+#include <avr/pgmspace.h>
 #include <avr/io.h>
 #include "sd_raw.h"
 
+#include <uart.h>
+
 /**
  * \addtogroup sd_raw MMC/SD/SDHC card raw access
  *
@@ -160,7 +163,7 @@ static uint8_t sd_raw_card_type;
 
 /* private helper functions */
 static void sd_raw_send_byte(uint8_t b);
-static uint8_t sd_raw_rec_byte();
+static uint8_t sd_raw_rec_byte(void);
 static uint8_t sd_raw_send_command(uint8_t command, uint32_t arg);
 
 /**
@@ -169,7 +172,7 @@ static uint8_t sd_raw_send_command(uint8_t command, uint32_t arg);
  *
  * \returns 0 on failure, 1 on success.
  */
-uint8_t sd_raw_init()
+uint8_t sd_raw_init(void)
 {
     /* enable inputs for reading card status */
     configure_pin_available();
@@ -925,6 +928,7 @@ uint8_t sd_raw_get_info(struct sd_raw_info* info)
        if(i == 0)
        {
            csd_structure = b >> 6;
+           (void)csd_structure;
        }
        else if(i == 14)
        {
index 6aa97502a470e20df04d1276876a9a8d1a1a6481..e4ab587093b4183f17d029df78735d5475171409 100644 (file)
--- a/sd_raw.h
+++ b/sd_raw.h
@@ -124,15 +124,15 @@ struct sd_raw_info
 typedef uint8_t (*sd_raw_read_interval_handler_t)(uint8_t* buffer, offset_t offset, void* p);
 typedef uintptr_t (*sd_raw_write_interval_handler_t)(uint8_t* buffer, offset_t offset, void* p);
 
-uint8_t sd_raw_init();
-uint8_t sd_raw_available();
-uint8_t sd_raw_locked();
+uint8_t sd_raw_init(void);
+uint8_t sd_raw_available(void);
+uint8_t sd_raw_locked(void);
 
 uint8_t sd_raw_read(offset_t offset, uint8_t* buffer, uintptr_t length);
 uint8_t sd_raw_read_interval(offset_t offset, uint8_t* buffer, uintptr_t interval, uintptr_t length, sd_raw_read_interval_handler_t callback, void* p);
 uint8_t sd_raw_write(offset_t offset, const uint8_t* buffer, uintptr_t length);
 uint8_t sd_raw_write_interval(offset_t offset, uint8_t* buffer, uintptr_t length, sd_raw_write_interval_handler_t callback, void* p);
-uint8_t sd_raw_sync();
+uint8_t sd_raw_sync(void);
 
 uint8_t sd_raw_get_info(struct sd_raw_info* info);