Skip to content

Commit

Permalink
fix multiple definition for new versions of gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejoPm03 committed May 9, 2022
1 parent e05d6d4 commit b909ae3
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 17 deletions.
6 changes: 6 additions & 0 deletions firmware/src/can_app.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#include "can_app.h"

uint8_t can_app_checks_without_mswi19_msg;
uint8_t can_app_send_state_clk_div;
uint8_t can_app_send_motor_clk_div;

uint8_t can_app_send_mcs_clk_div;

/**
* @brief Prints a can message via usart
*/
Expand Down
8 changes: 4 additions & 4 deletions firmware/src/can_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ void check_can(void);
#define CAN_APP_CHECKS_WITHOUT_MIC19_MSG 200

// can_app_checks
uint8_t can_app_checks_without_mswi19_msg;
uint8_t can_app_send_state_clk_div;
uint8_t can_app_send_motor_clk_div;
extern uint8_t can_app_checks_without_mswi19_msg;
extern uint8_t can_app_send_state_clk_div;
extern uint8_t can_app_send_motor_clk_div;

uint8_t can_app_send_mcs_clk_div;
extern uint8_t can_app_send_mcs_clk_div;

#endif /* ifndef CAN_APP_H */
3 changes: 3 additions & 0 deletions firmware/src/chronometer.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "chronometer.h"

volatile uint32_t chronometer_counter;
chronometers_t chronometers;

#define NUMBER_OF_CHRONOMETERS 3
static chronometer_t __chronometers[NUMBER_OF_CHRONOMETERS];

Expand Down
4 changes: 2 additions & 2 deletions firmware/src/chronometer.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "dbg_vrb.h"
#include "io.h"

volatile uint32_t chronometer_counter;
extern volatile uint32_t chronometer_counter;
#define TIME_STRING_LEN 13

typedef enum{
Expand Down Expand Up @@ -72,7 +72,7 @@ typedef struct{
chronometer_t *current_lap;
chronometer_t *last_lap;
} chronometers_t;
chronometers_t chronometers;
extern chronometers_t chronometers;

typedef struct{
uint8_t laps_counter;
Expand Down
2 changes: 2 additions & 0 deletions firmware/src/io.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "io.h"
#include "conf.h"

switches_t switches;

void leds_init(void)
{
#ifdef IO_ON
Expand Down
2 changes: 1 addition & 1 deletion firmware/src/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ typedef union{
#define SW_PORT (((PORTD) << 8) | (PORTC))
#define SW_DDR (((DDRD) << 8) | (DDRC))

switches_t switches;
extern switches_t switches;

typedef union{
struct{
Expand Down
16 changes: 16 additions & 0 deletions firmware/src/machine.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#include "machine.h"

// machine variables
volatile state_machine_t state_machine;
volatile system_flags_t system_flags;
volatile error_flags_t error_flags;

volatile uint8_t machine_clk;
volatile uint8_t machine_clk_divider;
volatile uint8_t total_errors; // Contagem de ERROS

// other variables
volatile uint8_t led_clk_div;
volatile uint8_t ui_clk_div;
volatile uint8_t ui_clk_div_2;
volatile uint16_t ui_timeout_clk_div;


/**
* @brief
*/
Expand Down
20 changes: 10 additions & 10 deletions firmware/src/machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,19 @@ void set_state_reset(void);
void ui_boat_info(void);

// machine variables
volatile state_machine_t state_machine;
volatile system_flags_t system_flags;
volatile error_flags_t error_flags;
extern volatile state_machine_t state_machine;
extern volatile system_flags_t system_flags;
extern volatile error_flags_t error_flags;

volatile uint8_t machine_clk;
volatile uint8_t machine_clk_divider;
volatile uint8_t total_errors; // Contagem de ERROS
extern volatile uint8_t machine_clk;
extern volatile uint8_t machine_clk_divider;
extern volatile uint8_t total_errors; // Contagem de ERROS

// other variables
volatile uint8_t led_clk_div;
volatile uint8_t ui_clk_div;
volatile uint8_t ui_clk_div_2;
volatile uint16_t ui_timeout_clk_div;
extern volatile uint8_t led_clk_div;
extern volatile uint8_t ui_clk_div;
extern volatile uint8_t ui_clk_div_2;
extern volatile uint16_t ui_timeout_clk_div;

// ISRs
ISR(TIMER2_COMPA_vect);
Expand Down

0 comments on commit b909ae3

Please sign in to comment.