diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json deleted file mode 100644 index c140ecc..0000000 --- a/.vscode/c_cpp_properties.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "configurations": [ - { - "name": "Linux", - "includePath": [ - "/usr/avr/include", - "${workspaceFolder}/**" - ], - "defines": [ - "__AVR_ATmega32U4__" - ], - "compilerPath": "/usr/bin/avr-gcc", - "cStandard": "c17", - "cppStandard": "c++14", - "intelliSenseMode": "linux-gcc-x64" - } - ], - "version": 4 -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 9104aa4..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "files.associations": { - "io.h": "c", - "sfr_defs.h": "c", - "string.h": "c", - "random": "c", - "math.h": "c", - "bridge.h": "c" - } -} \ No newline at end of file diff --git a/src/commands.c b/src/commands.c index d690bfe..a5a8a6e 100644 --- a/src/commands.c +++ b/src/commands.c @@ -167,4 +167,3 @@ int cmd_handle_switch_timer(void) { return timer1_on; } - diff --git a/src/include/commands.h b/src/include/commands.h index b712132..2c50e12 100644 --- a/src/include/commands.h +++ b/src/include/commands.h @@ -10,4 +10,3 @@ void cmd_handle(cmd_t *command); void cmd_handle_set(char *op1, char *op2); void cmd_handle_switch(char *op1, char *op2); int cmd_handle_switch_timer(void); - diff --git a/src/include/pins.h b/src/include/pins.h index 42c429d..ff553dc 100644 --- a/src/include/pins.h +++ b/src/include/pins.h @@ -3,4 +3,3 @@ void togglePin(volatile uint8_t *port, unsigned int pin); void unsetPin(volatile uint8_t *port, unsigned int pin); void setPin(volatile uint8_t *port, unsigned int pin); - diff --git a/src/include/pwm.h b/src/include/pwm.h index c326970..5202993 100644 --- a/src/include/pwm.h +++ b/src/include/pwm.h @@ -3,4 +3,3 @@ void pwm_init(void); void pwm_worker(void); void pwm_interrupt(void); - diff --git a/src/include/statemachine.h b/src/include/statemachine.h index add736c..3bfae28 100644 --- a/src/include/statemachine.h +++ b/src/include/statemachine.h @@ -12,4 +12,3 @@ typedef struct { } sm_t; void sm_handleTransition(sm_t *statemachine, sm_state_t to); - diff --git a/src/include/timer.h b/src/include/timer.h index a780edd..3e6418f 100644 --- a/src/include/timer.h +++ b/src/include/timer.h @@ -16,4 +16,3 @@ void tmr_enableT1(void); void tmr_disableT1(void); void tmr_setT1CompareMatch(uint16_t cm); uint16_t tmr_getT1Top(void); - diff --git a/src/include/uart.h b/src/include/uart.h index 91b1709..6a120be 100644 --- a/src/include/uart.h +++ b/src/include/uart.h @@ -3,4 +3,3 @@ void uart_init(unsigned int baud); void uart_sendByte(uint8_t byte); int uart_printf(char var, FILE *stream); - diff --git a/src/inverter.c b/src/inverter.c index 1cdf6c5..1a825cf 100644 --- a/src/inverter.c +++ b/src/inverter.c @@ -1,33 +1,32 @@ -#include #include +#include #include -#include "uart.h" -#include "timer.h" #include "commands.h" #include "pins.h" #include "pwm.h" +#include "timer.h" +#include "uart.h" -int main(void) -{ - sei(); +int main(void) { + sei(); - /* With this MCU frequency (16 MHz), 25 is a baudrate of 38.4k baud */ - uart_init(25); - pwm_init(); - tmr_initT1(); - tmr_enableT1(); + /* With this MCU frequency (16 MHz), 25 is a baudrate of 38.4k baud */ + uart_init(25); + pwm_init(); + tmr_initT1(); + tmr_enableT1(); - /* Arduino Leonardo has a LED that we turn off here */ - DDRC |= (1 << DDC7); - unsetPin(&PORTC, PIN7); + /* Arduino Leonardo has a LED that we turn off here */ + DDRC |= (1 << DDC7); + unsetPin(&PORTC, PIN7); - printf("Up and running.\n\r"); + printf("Up and running.\n\r"); - while (1) { - cmd_worker(); - pwm_worker(); - } + while (1) { + cmd_worker(); + pwm_worker(); + } - return 0; + return 0; } diff --git a/src/pins.c b/src/pins.c index 246ed28..38d4640 100644 --- a/src/pins.c +++ b/src/pins.c @@ -12,4 +12,3 @@ void unsetPin(volatile uint8_t *port, unsigned int pin) { void togglePin(volatile uint8_t *port, unsigned int pin) { *port ^= (1 << pin); } - diff --git a/src/pwm.c b/src/pwm.c index bb59271..1eb453e 100644 --- a/src/pwm.c +++ b/src/pwm.c @@ -1,6 +1,6 @@ -#include -#include #include +#include +#include #include "pwm.h" #include "timer.h" @@ -8,19 +8,11 @@ int interrupt_received = 0; uint32_t interrupt_counter = 0; -void pwm_init(void) -{ - tmr_subToT1Overflow(pwm_interrupt); +void pwm_init(void) { tmr_subToT1Overflow(pwm_interrupt); } + +void pwm_worker(void) { + if (!interrupt_received) + return; } -void pwm_worker(void) -{ - if (!interrupt_received) - return; - -} - -void pwm_interrupt(void) -{ - -} +void pwm_interrupt(void) {} diff --git a/src/statemachine.c b/src/statemachine.c index da3ecff..7015b70 100644 --- a/src/statemachine.c +++ b/src/statemachine.c @@ -1,4 +1,3 @@ #include "statemachine.h" void sm_handleTransition(sm_t *statemachine, sm_state_t to) {} -