diff --git a/src/adc.c b/src/adc.c index 490525ee..4786961c 100644 --- a/src/adc.c +++ b/src/adc.c @@ -9,12 +9,9 @@ #include #include #include "stm8s.h" -#include "pins.h" #include "stm8s_adc1.h" +#include "stm8s_gpio.h" #include "adc.h" -#include "ebike_app.h" -#include "motor.h" -#include "common.h" void adc_init(void) { diff --git a/src/adc.h b/src/adc.h index aa7a9703..0a69f208 100644 --- a/src/adc.h +++ b/src/adc.h @@ -6,10 +6,9 @@ * Released under the GPL License, Version 3 */ -#ifndef _ADC_H -#define _ADC_H +#ifndef ADC_H_ +#define ADC_H_ -#include "main.h" // for AIN6: 0x53E0 + 2*6 = 0x53E8 //#define UI8_ADC_BATTERY_VOLTAGE (*(uint8_t*)(0x53EC)) // AIN6 diff --git a/src/brake.c b/src/brake.c index 05692b2c..6b2dffc7 100644 --- a/src/brake.c +++ b/src/brake.c @@ -6,14 +6,9 @@ * Released under the GPL License, Version 3 */ -#include -#include "stm8s.h" -#include "stm8s_it.h" +#include "stm8s_gpio.h" #include "pins.h" -#include "main.h" -#include "interrupts.h" #include "brake.h" -#include "motor.h" void brake_init(void) { // brake pin as external input pin interrupt diff --git a/src/brake.h b/src/brake.h index c8d2e3cd..2842fe30 100644 --- a/src/brake.h +++ b/src/brake.h @@ -6,10 +6,8 @@ * Released under the GPL License, Version 3 */ -#ifndef _BRAKE_H -#define _BRAKE_H - -#include "main.h" +#ifndef BRAKE_H_ +#define BRAKE_H_ void brake_init (void); //BitStatus brake_is_set (void); diff --git a/src/common.c b/src/common.c index 34978c82..7631dc94 100644 --- a/src/common.c +++ b/src/common.c @@ -7,7 +7,6 @@ */ #include -#include "stm8s.h" #include "common.h" int16_t map_ui16(int16_t x, int16_t in_min, int16_t in_max, int16_t out_min, int16_t out_max) { diff --git a/src/ebike_app.c b/src/ebike_app.c index c7c8c878..661320e1 100644 --- a/src/ebike_app.c +++ b/src/ebike_app.c @@ -10,17 +10,14 @@ #include #include "stm8s.h" #include "stm8s_uart2.h" -#include "stm8s_gpio.h" #include "main.h" #include "interrupts.h" -#include "adc.h" #include "motor.h" -#include "pwm.h" #include "uart.h" -#include "brake.h" #include "eeprom.h" #include "lights.h" #include "common.h" +#include "config.h" volatile struct_configuration_variables m_configuration_variables; diff --git a/src/ebike_app.h b/src/ebike_app.h index 377ec808..39df99ee 100644 --- a/src/ebike_app.h +++ b/src/ebike_app.h @@ -6,11 +6,10 @@ * Released under the GPL License, Version 3 */ -#ifndef _EBIKE_APP_H_ -#define _EBIKE_APP_H_ +#ifndef EBIKE_APP_H_ +#define EBIKE_APP_H_ #include -#include "main.h" // startup boost mode #define CADENCE 0 diff --git a/src/eeprom.c b/src/eeprom.c index 57033f4e..30c58bda 100644 --- a/src/eeprom.c +++ b/src/eeprom.c @@ -7,6 +7,7 @@ */ #include +#include "main.h" #include "stm8s.h" #include "stm8s_flash.h" #include "eeprom.h" diff --git a/src/eeprom.h b/src/eeprom.h index 8785f867..50e7ed2d 100644 --- a/src/eeprom.h +++ b/src/eeprom.h @@ -6,10 +6,10 @@ * Released under the GPL License, Version 3 */ -#ifndef _EEPROM_H_ -#define _EEPROM_H_ +#ifndef EEPROM_H_ +#define EEPROM_H_ -#include "main.h" +#include #define EEPROM_BASE_ADDRESS 0x4000 diff --git a/src/interrupts.h b/src/interrupts.h index b53dd05f..2098efa0 100644 --- a/src/interrupts.h +++ b/src/interrupts.h @@ -6,8 +6,9 @@ * Released under the GPL License, Version 3 */ -#ifndef _INTERRUPTS_H_ -#define _INTERRUPTS_H_ +#ifndef INTERRUPTS_H_ +#define INTERRUPTS_H_ + #define EXTI_HALL_A_IRQ 7 // ITC_IRQ_PORTE - Hall sensor A rise/fall detection #define EXTI_HALL_B_IRQ 6 // ITC_IRQ_PORTD - Hall sensor B rise/fall detection diff --git a/src/lights.c b/src/lights.c index c91fd804..87311fdf 100644 --- a/src/lights.c +++ b/src/lights.c @@ -7,7 +7,6 @@ */ #include -#include "stm8s.h" #include "pins.h" #include "stm8s_gpio.h" diff --git a/src/lights.h b/src/lights.h index b359b6a1..2c58e966 100644 --- a/src/lights.h +++ b/src/lights.h @@ -6,10 +6,10 @@ * Released under the GPL License, Version 3 */ -#ifndef _LIGHTS_H_ -#define _LIGHTS_H_ +#ifndef LIGHTS_H_ +#define LIGHTS_H_ -#include "main.h" +#include void lights_init(void); void lights_set_state(uint8_t ui8_state); diff --git a/src/main.c b/src/main.c index 2dfc20cf..c95c69b7 100644 --- a/src/main.c +++ b/src/main.c @@ -9,7 +9,6 @@ #include #include "interrupts.h" #include "stm8s.h" -#include "pins.h" #include "uart.h" #include "pwm.h" #include "motor.h" diff --git a/src/main.h b/src/main.h index 6ca3561c..244bc1c9 100644 --- a/src/main.h +++ b/src/main.h @@ -6,9 +6,10 @@ * Released under the GPL License, Version 3 */ -#ifndef _MAIN_H_ -#define _MAIN_H_ +#ifndef MAIN_H_ +#define MAIN_H_ +#include #include "config.h" #include "common.h" diff --git a/src/motor.c b/src/motor.c index f402d896..ededb5f5 100644 --- a/src/motor.c +++ b/src/motor.c @@ -7,17 +7,13 @@ */ #include -#include +#include "main.h" #include "motor.h" #include "interrupts.h" #include "stm8s_gpio.h" #include "stm8s_tim1.h" #include "ebike_app.h" #include "pins.h" -#include "pwm.h" -#include "adc.h" -#include "uart.h" -#include "common.h" #include "eeprom.h" #define SVM_TABLE_LEN 256 diff --git a/src/motor.h b/src/motor.h index b0aca26d..cbfd9d2c 100644 --- a/src/motor.h +++ b/src/motor.h @@ -6,8 +6,8 @@ * Released under the GPL License, Version 3 */ -#ifndef _MOTOR_H_ -#define _MOTOR_H_ +#ifndef MOTOR_H_ +#define MOTOR_H_ #include diff --git a/src/pas.c b/src/pas.c index 54d8ef0d..68fb1dc6 100644 --- a/src/pas.c +++ b/src/pas.c @@ -6,13 +6,8 @@ * Released under the GPL License, Version 3 */ -#include -#include "stm8s.h" +#include "stm8s_gpio.h" #include "pins.h" -#include "interrupts.h" -#include "motor.h" -#include "main.h" -#include "ebike_app.h" void pas_init(void) { //PAS1 pin as external input pin diff --git a/src/pas.h b/src/pas.h index e4bc416a..e06cf03d 100644 --- a/src/pas.h +++ b/src/pas.h @@ -6,10 +6,8 @@ * Released under the GPL License, Version 3 */ -#ifndef _PAS_H_ -#define _PAS_H_ - -#include "main.h" +#ifndef PAS_H_ +#define PAS_H_ void pas_init(void); void pas2_init(void); diff --git a/src/pins.h b/src/pins.h index aa748b13..e4039339 100644 --- a/src/pins.h +++ b/src/pins.h @@ -6,8 +6,8 @@ * Released under the GPL License, Version 3 */ -#ifndef _PINS_H_ -#define _PINS_H_ +#ifndef PINS_H_ +#define PINS_H_ #include "stm8s_gpio.h" diff --git a/src/pwm.c b/src/pwm.c index c46ca82e..d255cb09 100644 --- a/src/pwm.c +++ b/src/pwm.c @@ -10,9 +10,7 @@ #include "stm8s_tim1.h" #include "stm8s_flash.h" #include "main.h" -#include "interrupts.h" #include "pwm.h" -#include "pins.h" void pwm_init(void) { // verify if PWM N channels are active on option bytes, if not, enable diff --git a/src/pwm.h b/src/pwm.h index 1244ac44..f17f7ab7 100644 --- a/src/pwm.h +++ b/src/pwm.h @@ -6,8 +6,8 @@ * Released under the GPL License, Version 3 */ -#ifndef _PWM_H -#define _PWM_H +#ifndef PWM_H_ +#define PWM_H_ void pwm_init(void); diff --git a/src/timers.c b/src/timers.c index 166a5448..41dd101b 100644 --- a/src/timers.c +++ b/src/timers.c @@ -6,6 +6,7 @@ * Released under the GPL License, Version 3 */ +#include "timers.h" #include "stm8s.h" #include "interrupts.h" diff --git a/src/timers.h b/src/timers.h index 93404f92..0b079d14 100644 --- a/src/timers.h +++ b/src/timers.h @@ -6,8 +6,10 @@ * Released under the GPL License, Version 3 */ -#ifndef _TIMERS_H_ -#define _TIMERS_H_ +#ifndef TIMERS_H_ +#define TIMERS_H_ + +#include void timers_init(void); diff --git a/src/torque_sensor.c b/src/torque_sensor.c index b3dfd068..229ab5c0 100644 --- a/src/torque_sensor.c +++ b/src/torque_sensor.c @@ -6,7 +6,6 @@ * Released under the GPL License, Version 3 */ -#include "stm8s.h" #include "stm8s_gpio.h" #include "pins.h" #include "torque_sensor.h" diff --git a/src/torque_sensor.h b/src/torque_sensor.h index 1bb58dee..5a534085 100644 --- a/src/torque_sensor.h +++ b/src/torque_sensor.h @@ -6,11 +6,8 @@ * Released under the GPL License, Version 3 */ -#ifndef _TORQUE_SENSOR_H_ -#define _TORQUE_SENSOR_H_ - -#include "main.h" -#include "stm8s_gpio.h" +#ifndef TORQUE_SENSOR_H_ +#define TORQUE_SENSOR_H_ void torque_sensor_init(void); diff --git a/src/uart.c b/src/uart.c index 5805562b..c024675f 100644 --- a/src/uart.c +++ b/src/uart.c @@ -6,12 +6,9 @@ * Released under the GPL License, Version 3 */ -#include +#include "uart.h" #include - #include "stm8s.h" -#include "stm8s_uart2.h" -#include "main.h" #include "interrupts.h" diff --git a/src/uart.h b/src/uart.h index 1979e8c1..b264fafd 100644 --- a/src/uart.h +++ b/src/uart.h @@ -6,10 +6,8 @@ * Released under the GPL License, Version 3 */ -#ifndef _UART_H -#define _UART_H - -#include "main.h" +#ifndef UART_H_ +#define UART_H_ void uart2_init(void); diff --git a/src/wheel_speed_sensor.c b/src/wheel_speed_sensor.c index 946ba57d..b99f89c0 100644 --- a/src/wheel_speed_sensor.c +++ b/src/wheel_speed_sensor.c @@ -6,12 +6,8 @@ * Released under the GPL License, Version 3 */ -#include -#include "stm8s.h" +#include "stm8s_gpio.h" #include "pins.h" -#include "main.h" -#include "interrupts.h" -#include "motor.h" void wheel_speed_sensor_init(void) { //wheel speed sensor pin as input pull-up, no external interrupt diff --git a/src/wheel_speed_sensor.h b/src/wheel_speed_sensor.h index 56c0dae2..f8099a16 100644 --- a/src/wheel_speed_sensor.h +++ b/src/wheel_speed_sensor.h @@ -6,8 +6,8 @@ * Released under the GPL License, Version 3 */ -#ifndef _WHELL_SPEED_SENSOR_H_ -#define _WHELL_SPEED_SENSOR_H_ +#ifndef WHELL_SPEED_SENSOR_H_ +#define WHELL_SPEED_SENSOR_H_ void wheel_speed_sensor_init(void);