diff options
author | Maximilien Cuony <maximilien@theglu.org> | 2016-06-05 22:28:56 +0200 |
---|---|---|
committer | Maximilien Cuony <maximilien@theglu.org> | 2016-06-05 22:28:56 +0200 |
commit | 765b06950c1a5b55bb96a29f9da3c136f790a0f2 (patch) | |
tree | ebe75c291b201a16cf16ed52fbfc2c82d13a98ff /src/simulator | |
parent | 327114f6c35a2c28004eb950baf5d1c1c175824a (diff) | |
download | glutte-o-matic-765b06950c1a5b55bb96a29f9da3c136f790a0f2.tar.gz glutte-o-matic-765b06950c1a5b55bb96a29f9da3c136f790a0f2.tar.bz2 glutte-o-matic-765b06950c1a5b55bb96a29f9da3c136f790a0f2.zip |
Fix warnings
Diffstat (limited to 'src/simulator')
-rw-r--r-- | src/simulator/src/Audio/audio.c | 14 | ||||
-rw-r--r-- | src/simulator/src/Audio/cw.c | 5 | ||||
-rw-r--r-- | src/simulator/src/Core/common.c | 3 | ||||
-rw-r--r-- | src/simulator/src/Core/delay.c | 5 | ||||
-rw-r--r-- | src/simulator/src/Core/main.c | 10 | ||||
-rw-r--r-- | src/simulator/src/GPIO/i2c.c | 26 | ||||
-rw-r--r-- | src/simulator/src/GPIO/i2c.h | 27 | ||||
-rw-r--r-- | src/simulator/src/GPIO/pio.c | 25 | ||||
-rw-r--r-- | src/simulator/src/GPIO/temperature.c | 27 | ||||
-rw-r--r-- | src/simulator/src/GPIO/usart.c | 6 | ||||
-rw-r--r-- | src/simulator/src/GPS/gps.c | 1 | ||||
-rw-r--r-- | src/simulator/src/GPS/gps_sim.h | 27 | ||||
-rw-r--r-- | src/simulator/src/Gui/gui.c | 39 | ||||
-rw-r--r-- | src/simulator/src/Gui/gui.h | 27 |
14 files changed, 226 insertions, 16 deletions
diff --git a/src/simulator/src/Audio/audio.c b/src/simulator/src/Audio/audio.c index 51a7f3d..851b1d9 100644 --- a/src/simulator/src/Audio/audio.c +++ b/src/simulator/src/Audio/audio.c @@ -33,12 +33,12 @@ pa_simple *s = NULL; int current_buffer_length = 0; int16_t * current_buffer_samples; -static void audio_buffer_sent(); +static void audio_buffer_sent(void); static void audio_buffer_sender(void *args); extern char gui_audio_on; -void audio_initialize_platform(int plln, int pllr, int i2sdiv, int i2sodd, int rate) { +void audio_initialize_platform(int __attribute__ ((unused))plln, int __attribute__ ((unused))pllr, int __attribute__ ((unused))i2sdiv, int __attribute__ ((unused))i2sodd, int rate) { int error; @@ -50,7 +50,9 @@ void audio_initialize_platform(int plln, int pllr, int i2sdiv, int i2sodd, int r ss.rate = rate; - if (s = pa_simple_new(NULL, "Glutte", PA_STREAM_PLAYBACK, NULL, "playback", &ss, NULL, NULL, &error)) { + s = pa_simple_new(NULL, "Glutte", PA_STREAM_PLAYBACK, NULL, "playback", &ss, NULL, NULL, &error); + + if (s) { } else { printf("Pulseaudio playback init error\n"); @@ -69,7 +71,7 @@ void audio_initialize_platform(int plln, int pllr, int i2sdiv, int i2sodd, int r } -static void audio_buffer_sender(void *args) { +static void audio_buffer_sender(void __attribute__ ((unused)) *args) { while(1) { @@ -102,11 +104,11 @@ void audio_off() { gui_audio_on = 0; } -void audio_set_volume(int volume) { +void audio_set_volume(int __attribute__ ((unused))volume) { } -void audio_output_sample_without_blocking(int16_t sample) { +void audio_output_sample_without_blocking(int16_t __attribute__ ((unused))sample) { } void audio_play_with_callback(AudioCallbackFunction *callback, void *context) { diff --git a/src/simulator/src/Audio/cw.c b/src/simulator/src/Audio/cw.c index e9321da..f745297 100644 --- a/src/simulator/src/Audio/cw.c +++ b/src/simulator/src/Audio/cw.c @@ -22,9 +22,14 @@ * SOFTWARE. */ +#include "Audio/cw.h" + extern char gui_cw_text[4096]; int gui_cw_text_pointer = 0; +void cw_move_buffer_up(void); +void cw_move_buffer_up(void); + void cw_move_buffer_up() { for (int i = 0; i <= 4010; i++) { diff --git a/src/simulator/src/Core/common.c b/src/simulator/src/Core/common.c index 8b2fe09..56281a8 100644 --- a/src/simulator/src/Core/common.c +++ b/src/simulator/src/Core/common.c @@ -1,2 +1,5 @@ +#include "Core/common.h" + +// Fake the function void __disable_irq() { } diff --git a/src/simulator/src/Core/delay.c b/src/simulator/src/Core/delay.c index 96f8dd5..eeda587 100644 --- a/src/simulator/src/Core/delay.c +++ b/src/simulator/src/Core/delay.c @@ -1,4 +1,7 @@ -void delay_init() { +#include "Core/delay.h" +#include <unistd.h> + +void delay_init(void) { } void delay_us(int micros) { diff --git a/src/simulator/src/Core/main.c b/src/simulator/src/Core/main.c index faf7fd7..d190bce 100644 --- a/src/simulator/src/Core/main.c +++ b/src/simulator/src/Core/main.c @@ -32,8 +32,14 @@ #include "task.h" #include "timers.h" #include "semphr.h" +#include "src/GPS/gps_sim.h" +#include "src/Gui/gui.h" -static void thread_gui(void *arg) { + +void init(void); + + +static void thread_gui(void __attribute__ ((unused))*arg) { main_gui(); } @@ -67,7 +73,7 @@ int gui_gps_custom_month_len; char gui_gps_custom_year[4]; int gui_gps_custom_year_len; -static void thread_gui_gps(void *arg) { +static void thread_gui_gps(void __attribute__ ((unused))*arg) { while(1) { vTaskDelay(1000 / portTICK_RATE_MS); diff --git a/src/simulator/src/GPIO/i2c.c b/src/simulator/src/GPIO/i2c.c index e529543..5de3180 100644 --- a/src/simulator/src/GPIO/i2c.c +++ b/src/simulator/src/GPIO/i2c.c @@ -1,2 +1,28 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2016 Matthias P. Braendli, Maximilien Cuony + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ + +#include "i2c.h" + void i2c_init() { } diff --git a/src/simulator/src/GPIO/i2c.h b/src/simulator/src/GPIO/i2c.h index e69de29..df761af 100644 --- a/src/simulator/src/GPIO/i2c.h +++ b/src/simulator/src/GPIO/i2c.h @@ -0,0 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2016 Matthias P. Braendli, Maximilien Cuony + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ + +#pragma once + +void i2c_init(void); diff --git a/src/simulator/src/GPIO/pio.c b/src/simulator/src/GPIO/pio.c index 36a6baf..cc16f73 100644 --- a/src/simulator/src/GPIO/pio.c +++ b/src/simulator/src/GPIO/pio.c @@ -1,4 +1,29 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2016 Matthias P. Braendli, Maximilien Cuony + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ + #include "Core/fsm.h" +#include "GPIO/pio.h" extern char gui_out_tx; extern char gui_out_mod_off; diff --git a/src/simulator/src/GPIO/temperature.c b/src/simulator/src/GPIO/temperature.c index 7c343be..34b079c 100644 --- a/src/simulator/src/GPIO/temperature.c +++ b/src/simulator/src/GPIO/temperature.c @@ -1,3 +1,28 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2016 Matthias P. Braendli, Maximilien Cuony + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ + + #include "GPIO/temperature.h" #include "FreeRTOS.h" #include "task.h" @@ -5,7 +30,7 @@ extern int gui_temperature_valid; extern float gui_temperature; -void temperature_task(void *pvParameters) { +void temperature_task(void __attribute__ ((unused))*pvParameters) { while (1) { diff --git a/src/simulator/src/GPIO/usart.c b/src/simulator/src/GPIO/usart.c index 37822d6..3782b9f 100644 --- a/src/simulator/src/GPIO/usart.c +++ b/src/simulator/src/GPIO/usart.c @@ -23,13 +23,15 @@ */ -#include "../../../common/includes/GPIO/usart.h" +#include "GPIO/usart.h" +#include "src/Gui/gui.h" extern char uart_recv_txt[4096]; int uart_recv_pointer = 0; -void usart_move_buffer_up(); +void usart_move_buffer_up(void); +void gui_usart_send(char *); void usart_init() { diff --git a/src/simulator/src/GPS/gps.c b/src/simulator/src/GPS/gps.c index 728d165..763e78f 100644 --- a/src/simulator/src/GPS/gps.c +++ b/src/simulator/src/GPS/gps.c @@ -1,4 +1,5 @@ #include "GPIO/usart.h" +#include "src/GPS/gps_sim.h" void gps_usart_send(char * string) { diff --git a/src/simulator/src/GPS/gps_sim.h b/src/simulator/src/GPS/gps_sim.h new file mode 100644 index 0000000..b0c8cdf --- /dev/null +++ b/src/simulator/src/GPS/gps_sim.h @@ -0,0 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2016 Matthias P. Braendli, Maximilien Cuony + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ + +#pragma once + +void gps_usart_send(char *); diff --git a/src/simulator/src/Gui/gui.c b/src/simulator/src/Gui/gui.c index 713b18a..b1be5a8 100644 --- a/src/simulator/src/Gui/gui.c +++ b/src/simulator/src/Gui/gui.c @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2016 Matthias P. Braendli, Maximilien Cuony + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ + #include "FreeRTOS.h" #include "FreeRTOSConfig.h" #include "task.h" @@ -13,6 +37,8 @@ #include <time.h> #include <limits.h> +#include "gui.h" + #define NK_INCLUDE_FIXED_TYPES #define NK_INCLUDE_STANDARD_IO #define NK_INCLUDE_DEFAULT_ALLOCATOR @@ -22,7 +48,14 @@ #define NK_IMPLEMENTATION #define NK_XLIB_GL3_IMPLEMENTATION #define NK_XLIB_LOAD_OPENGL_EXTENSIONS + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#pragma GCC diagnostic ignored "-Wunused-value" +#pragma GCC diagnostic ignored "-Wunused-function" #include "nuklear.h" +#pragma GCC diagnostic pop + #include "nuklear_xlib_gl3.h" #define WINDOW_WIDTH 1200 @@ -152,8 +185,7 @@ struct XWindow { }; static int gl_err = FALSE; -static int gl_error_handler(Display *dpy, XErrorEvent *ev) { - UNUSED((dpy, ev)); +static int gl_error_handler(Display __attribute__ ((unused))*dpy, XErrorEvent __attribute__ ((unused))*ev) { gl_err = TRUE; return 0; } @@ -191,7 +223,7 @@ static int has_extension(const char *string, const char *ext) { } -int main_gui() { +void main_gui() { /* Platform */ int running = 1; struct XWindow win; @@ -848,6 +880,5 @@ int main_gui() { XFreeColormap(win.dpy, win.cmap); XDestroyWindow(win.dpy, win.win); XCloseDisplay(win.dpy); - return 0; } diff --git a/src/simulator/src/Gui/gui.h b/src/simulator/src/Gui/gui.h new file mode 100644 index 0000000..fac0013 --- /dev/null +++ b/src/simulator/src/Gui/gui.h @@ -0,0 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2016 Matthias P. Braendli, Maximilien Cuony + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ + +#pragma once + +void main_gui(void); |