aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorMaximilien Cuony <maximilien@theglu.org>2016-06-06 18:49:25 +0200
committerMaximilien Cuony <maximilien@theglu.org>2016-06-06 18:49:25 +0200
commite2e1af13be32fe00f98135beb62617ea0bba7bc8 (patch)
tree5ff81acadb2f5b9d7fee2269d746253a1f6bad49 /src/common
parent2e4b80bc0fdae03f6e00b76000c16d12682e0479 (diff)
downloadglutte-o-matic-e2e1af13be32fe00f98135beb62617ea0bba7bc8.tar.gz
glutte-o-matic-e2e1af13be32fe00f98135beb62617ea0bba7bc8.tar.bz2
glutte-o-matic-e2e1af13be32fe00f98135beb62617ea0bba7bc8.zip
Fix warnings, add more warnings flags, normalize makefiles
Diffstat (limited to 'src/common')
-rw-r--r--src/common/includes/Audio/audio.h2
-rw-r--r--src/common/includes/Audio/cw.h2
-rw-r--r--src/common/includes/Core/common.h5
-rw-r--r--src/common/includes/Core/fsm.h10
-rw-r--r--src/common/includes/GPIO/i2c.h2
-rw-r--r--src/common/includes/GPIO/temperature.h6
-rw-r--r--src/common/includes/GPS/gps.h4
-rw-r--r--src/common/src/Audio/cw.c6
-rw-r--r--src/common/src/Core/common.c2
-rw-r--r--src/common/src/Core/fsm.c1
-rw-r--r--src/common/src/Core/main.c18
-rw-r--r--src/common/src/GPS/gps.c2
12 files changed, 39 insertions, 21 deletions
diff --git a/src/common/includes/Audio/audio.h b/src/common/includes/Audio/audio.h
index a4ac2da..573c157 100644
--- a/src/common/includes/Audio/audio.h
+++ b/src/common/includes/Audio/audio.h
@@ -59,4 +59,6 @@ void audio_stop(void);
void audio_provide_buffer(void *samples,int numsamples);
bool audio_provide_buffer_without_blocking(void *samples,int numsamples);
+void DMA1_Stream7_IRQHandler(void);
+
#endif
diff --git a/src/common/includes/Audio/cw.h b/src/common/includes/Audio/cw.h
index ccb13ab..39be9c5 100644
--- a/src/common/includes/Audio/cw.h
+++ b/src/common/includes/Audio/cw.h
@@ -47,5 +47,7 @@ int cw_psk31_busy(void);
void cw_message_sent(const char*);
+size_t cw_symbol(uint8_t, uint8_t *, size_t);
+
#endif // __CW_H_
diff --git a/src/common/includes/Core/common.h b/src/common/includes/Core/common.h
index 950085c..b0927c8 100644
--- a/src/common/includes/Core/common.h
+++ b/src/common/includes/Core/common.h
@@ -58,6 +58,11 @@ int random_bool(void);
#define FAULT_SOURCE_USART 4
void trigger_fault(int source);
+
+int find_last_sunday(const struct tm*);
+
#ifdef SIMULATOR
void __disable_irq(void);
+#else
+void hard_fault_handler_c(uint32_t *);
#endif
diff --git a/src/common/includes/Core/fsm.h b/src/common/includes/Core/fsm.h
index c061597..75f1f46 100644
--- a/src/common/includes/Core/fsm.h
+++ b/src/common/includes/Core/fsm.h
@@ -25,6 +25,8 @@
#ifndef _FSM_H_
#define _FSM_H_
+#include <stdint.h>
+
// List of all states the FSM of the relay can be in
enum fsm_state_e {
FSM_OISIF = 0, // Idle
@@ -88,10 +90,10 @@ struct fsm_output_signals_t {
};
// Initialise local structures
-void fsm_init();
+void fsm_init(void);
// Call the FSM once and update the internal state
-void fsm_update();
+void fsm_update(void);
// Setter for inputs
void fsm_update_inputs(struct fsm_input_signals_t* inputs);
@@ -102,5 +104,9 @@ void fsm_get_outputs(struct fsm_output_signals_t* out);
// Announce a state change
void fsm_state_switched(const char *new_state);
+uint64_t fsm_current_state_time_ms(void);
+uint64_t fsm_current_state_time_s(void);
+const char* fsm_select_letter(void);
+
#endif // _FSM_H_
diff --git a/src/common/includes/GPIO/i2c.h b/src/common/includes/GPIO/i2c.h
index 109213b..69a4ad2 100644
--- a/src/common/includes/GPIO/i2c.h
+++ b/src/common/includes/GPIO/i2c.h
@@ -28,7 +28,7 @@
#include <stdint.h>
/* Initialise I2C on the board for both the audio codec and the GPS receiver */
-void i2c_init();
+void i2c_init(void);
/* Do an I2C write, return 1 on success, 0 on failure */
int i2c_write(uint8_t device, const uint8_t *txbuf, int len);
diff --git a/src/common/includes/GPIO/temperature.h b/src/common/includes/GPIO/temperature.h
index a0e5b5d..f49cc26 100644
--- a/src/common/includes/GPIO/temperature.h
+++ b/src/common/includes/GPIO/temperature.h
@@ -29,12 +29,12 @@ extern float _temperature_last_value;
extern int _temperature_valid;
// Setup communication and temperature
-void temperature_init();
+void temperature_init(void);
// Return 1 if the temperature is valid
-int temperature_valid();
+int temperature_valid(void);
// Get current temperature
-float temperature_get();
+float temperature_get(void);
void temperature_task(void *);
diff --git a/src/common/includes/GPS/gps.h b/src/common/includes/GPS/gps.h
index 768ade1..ec5ec77 100644
--- a/src/common/includes/GPS/gps.h
+++ b/src/common/includes/GPS/gps.h
@@ -35,10 +35,10 @@
*/
// Setup communication and GPS receiver
-void gps_init();
+void gps_init(void);
// Return 1 of the GPS is receiving time
-int gps_locked();
+int gps_locked(void);
// Get current time from GPS
// Returns 1 if time is valid, 0 otherwise
diff --git a/src/common/src/Audio/cw.c b/src/common/src/Audio/cw.c
index e4a04f5..1922469 100644
--- a/src/common/src/Audio/cw.c
+++ b/src/common/src/Audio/cw.c
@@ -37,8 +37,10 @@
#include "Audio/cw.h"
#include "Core/common.h"
#include "Audio/audio.h"
+#include <string.h>
#ifdef SIMULATOR
+#include <math.h>
#define arm_cos_f32 cosf
#define arm_sin_f32 sinf
#else
@@ -461,7 +463,7 @@ static struct cw_message_s cw_fill_msg_current;
// Routine to generate CW audio
static float cw_generate_audio_ampl = 0.0f;
static float cw_generate_audio_nco = 0.0f;
-static int16_t cw_generate_audio(float omega, int i, int t)
+static int16_t cw_generate_audio(float omega, int i, int __attribute__ ((unused))t)
{
int16_t s = 0;
// Remove clicks from CW
@@ -516,7 +518,7 @@ static int16_t psk31_generate_audio(float omega, int i, int t, int samples_per_s
}
#endif
-static void cw_psk31_task(void *pvParameters)
+static void cw_psk31_task(void __attribute__ ((unused))*pvParameters)
{
int buf_pos = 0;
diff --git a/src/common/src/Core/common.c b/src/common/src/Core/common.c
index 77d3360..d231569 100644
--- a/src/common/src/Core/common.c
+++ b/src/common/src/Core/common.c
@@ -161,7 +161,7 @@ void common_init(void)
lfsr = lfsr_start_state;
}
-static void common_increase_timestamp(TimerHandle_t t)
+static void common_increase_timestamp(TimerHandle_t __attribute__ ((unused))t)
{
#ifdef SIMULATOR
diff --git a/src/common/src/Core/fsm.c b/src/common/src/Core/fsm.c
index d2c95f6..03180e0 100644
--- a/src/common/src/Core/fsm.c
+++ b/src/common/src/Core/fsm.c
@@ -23,6 +23,7 @@
*/
#include <string.h>
+#include <stdint.h>
#include "Core/common.h"
#include "Core/fsm.h"
#include "GPIO/usart.h"
diff --git a/src/common/src/Core/main.c b/src/common/src/Core/main.c
index 6a546a1..75a444a 100644
--- a/src/common/src/Core/main.c
+++ b/src/common/src/Core/main.c
@@ -64,9 +64,9 @@ static void launcher_task(void *pvParameters);
// Audio callback function
static void audio_callback(void* context, int select_buffer);
-void vApplicationStackOverflowHook( TaskHandle_t xTask,
- signed char *pcTaskName )
-{
+void vApplicationStackOverflowHook(TaskHandle_t, signed char *);
+
+void vApplicationStackOverflowHook(TaskHandle_t __attribute__ ((unused)) xTask, signed char *pcTaskName) {
usart_debug("TASK OVERFLOW %s\r\n", pcTaskName);
while (1) {};
}
@@ -107,7 +107,7 @@ int main(void) {
}
-static void test_task(void *pvParameters) {
+static void test_task(void __attribute__ ((unused))*pvParameters) {
int i = 0;
@@ -129,7 +129,7 @@ static void test_task(void *pvParameters) {
// Launcher task is here to make sure the scheduler is
// already running when calling the init functions.
-static void launcher_task(void *pvParameters)
+static void launcher_task(void __attribute__ ((unused))*pvParameters)
{
usart_debug_puts("CW init\r\n");
cw_psk31_init(16000);
@@ -227,7 +227,7 @@ static void launcher_task(void *pvParameters)
}
-static void detect_button_press(void *pvParameters)
+static void detect_button_press(void __attribute__ ((unused))*pvParameters)
{
int pin_high_count = 0;
int last_pin_high_count = 0;
@@ -270,7 +270,7 @@ static void detect_button_press(void *pvParameters)
}
}
-static void audio_callback(void* context, int select_buffer) {
+static void audio_callback(void __attribute__ ((unused))*context, int select_buffer) {
static int16_t audio_buffer0[AUDIO_BUF_LEN];
static int16_t audio_buffer1[AUDIO_BUF_LEN];
int16_t *samples;
@@ -300,7 +300,7 @@ static void audio_callback(void* context, int select_buffer) {
}
static struct tm gps_time;
-static void gps_monit_task(void *pvParameters) {
+static void gps_monit_task(void __attribute__ ((unused))*pvParameters) {
leds_turn_on(LED_BLUE);
@@ -355,7 +355,7 @@ static void gps_monit_task(void *pvParameters) {
}
static struct fsm_input_signals_t fsm_input;
-static void exercise_fsm(void *pvParameters)
+static void exercise_fsm(void __attribute__ ((unused))*pvParameters)
{
int cw_last_trigger = 0;
int last_tm_trigger = 0;
diff --git a/src/common/src/GPS/gps.c b/src/common/src/GPS/gps.c
index 568a181..a1fb043 100644
--- a/src/common/src/GPS/gps.c
+++ b/src/common/src/GPS/gps.c
@@ -65,7 +65,7 @@ int gps_utctime(struct tm *timeutc) {
#define RXBUF_LEN MAX_NMEA_SENTENCE_LEN
static char rxbuf[RXBUF_LEN];
-static void gps_task(void *pvParameters) {
+static void gps_task(void __attribute__ ((unused))*pvParameters) {
// Periodically reinit the GPS
while (1) {
taskYIELD();