Fix indents and switch syntax

Fix indentions in `spi_byte()` and add missing space after `switch`
keywords.
This commit is contained in:
finga 2021-09-11 00:21:01 +02:00
parent 6eb515e2d4
commit e2d30d7050

View file

@ -104,10 +104,10 @@ void spi_init(void) {
} }
uint8_t spi_byte(uint8_t data) { uint8_t spi_byte(uint8_t data) {
SPDR = data; SPDR = data;
while(!(SPSR & (1 << SPIF))); while(!(SPSR & (1 << SPIF)));
return SPDR; return SPDR;
} }
void lcd_write(uint8_t data) { void lcd_write(uint8_t data) {
SPI_PORT &= ~(1 << SPI_SS); SPI_PORT &= ~(1 << SPI_SS);
@ -256,7 +256,7 @@ static void lcd_home(void) {
bool ch3_selected = false; bool ch3_selected = false;
bool setup_selected = false; bool setup_selected = false;
switch(home_state) { switch (home_state) {
case ch1: case ch1:
ch1_selected = true; ch1_selected = true;
break; break;
@ -425,7 +425,7 @@ static void lcd_setup(void) {
} }
static void change_state(enum state new_state) { static void change_state(enum state new_state) {
switch(new_state) { switch (new_state) {
case home: case home:
lcd_home(); lcd_home();
current_state = home; current_state = home;
@ -500,7 +500,7 @@ static void update_state(enum input event) {
ISR(PCINT0_vect) { ISR(PCINT0_vect) {
cli(); cli();
switch(enc) { switch (enc) {
case 0: case 0:
if (ENC_A && !ENC_B) if (ENC_A && !ENC_B)
enc = 1; enc = 1;