summaryrefslogtreecommitdiff
path: root/platforms/avr/drivers
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2022-02-12 10:29:31 -0800
committerGitHub <noreply@github.com>2022-02-12 18:29:31 +0000
commit63646e8906e062d1c1de3925cba70c4e3426a855 (patch)
tree4e91648b77b838e1125cf86331d7e84bde6d07a9 /platforms/avr/drivers
parentafcdd7079c774dec2aa4b7f2d08adf8b7310919b (diff)
Format code according to conventions (#16322)
Diffstat (limited to 'platforms/avr/drivers')
-rw-r--r--platforms/avr/drivers/analog.c8
-rw-r--r--platforms/avr/drivers/analog.h18
-rw-r--r--platforms/avr/drivers/audio_pwm_hardware.c8
-rw-r--r--platforms/avr/drivers/glcdfont.c18
-rw-r--r--platforms/avr/drivers/hd44780.c22
-rw-r--r--platforms/avr/drivers/i2c_master.c6
-rw-r--r--platforms/avr/drivers/i2c_slave.c12
-rw-r--r--platforms/avr/drivers/i2c_slave.h6
-rw-r--r--platforms/avr/drivers/ps2/ps2_io.c8
-rw-r--r--platforms/avr/drivers/ps2/ps2_usart.c8
-rw-r--r--platforms/avr/drivers/serial.c116
-rw-r--r--platforms/avr/drivers/spi_master.c2
-rw-r--r--platforms/avr/drivers/ssd1306.c22
-rw-r--r--platforms/avr/drivers/uart.c4
-rw-r--r--platforms/avr/drivers/ws2812.c14
-rw-r--r--platforms/avr/drivers/ws2812_i2c.c4
16 files changed, 160 insertions, 116 deletions
diff --git a/platforms/avr/drivers/analog.c b/platforms/avr/drivers/analog.c
index 628835ccef..ed4d563609 100644
--- a/platforms/avr/drivers/analog.c
+++ b/platforms/avr/drivers/analog.c
@@ -21,9 +21,13 @@
static uint8_t aref = ADC_REF_POWER;
-void analogReference(uint8_t mode) { aref = mode & (_BV(REFS1) | _BV(REFS0)); }
+void analogReference(uint8_t mode) {
+ aref = mode & (_BV(REFS1) | _BV(REFS0));
+}
-int16_t analogReadPin(pin_t pin) { return adc_read(pinToMux(pin)); }
+int16_t analogReadPin(pin_t pin) {
+ return adc_read(pinToMux(pin));
+}
uint8_t pinToMux(pin_t pin) {
switch (pin) {
diff --git a/platforms/avr/drivers/analog.h b/platforms/avr/drivers/analog.h
index fa2fb0d89b..fb13e106ff 100644
--- a/platforms/avr/drivers/analog.h
+++ b/platforms/avr/drivers/analog.h
@@ -32,21 +32,21 @@ int16_t adc_read(uint8_t mux);
}
#endif
-#define ADC_REF_EXTERNAL 0 // AREF, Internal Vref turned off
-#define ADC_REF_POWER _BV(REFS0) // AVCC with external capacitor on AREF pin
-#define ADC_REF_INTERNAL (_BV(REFS1) | _BV(REFS0)) // Internal 2.56V Voltage Reference with external capacitor on AREF pin (1.1V for 328P)
+#define ADC_REF_EXTERNAL 0 // AREF, Internal Vref turned off
+#define ADC_REF_POWER _BV(REFS0) // AVCC with external capacitor on AREF pin
+#define ADC_REF_INTERNAL (_BV(REFS1) | _BV(REFS0)) // Internal 2.56V Voltage Reference with external capacitor on AREF pin (1.1V for 328P)
// These prescaler values are for high speed mode, ADHSM = 1
#if F_CPU == 16000000L || F_CPU == 12000000L
-# define ADC_PRESCALER (_BV(ADPS2) | _BV(ADPS1)) // /64
+# define ADC_PRESCALER (_BV(ADPS2) | _BV(ADPS1)) // /64
#elif F_CPU == 8000000L
-# define ADC_PRESCALER (_BV(ADPS2) | _BV(ADPS0)) // /32
+# define ADC_PRESCALER (_BV(ADPS2) | _BV(ADPS0)) // /32
#elif F_CPU == 4000000L
-# define ADC_PRESCALER (_BV(ADPS2)) // /16
+# define ADC_PRESCALER (_BV(ADPS2)) // /16
#elif F_CPU == 2000000L
-# define ADC_PRESCALER (_BV(ADPS1) | _BV(ADPS0)) // /8
+# define ADC_PRESCALER (_BV(ADPS1) | _BV(ADPS0)) // /8
#elif F_CPU == 1000000L
-# define ADC_PRESCALER _BV(ADPS1) // /4
+# define ADC_PRESCALER _BV(ADPS1) // /4
#else
-# define ADC_PRESCALER _BV(ADPS0) // /2
+# define ADC_PRESCALER _BV(ADPS0) // /2
#endif
diff --git a/platforms/avr/drivers/audio_pwm_hardware.c b/platforms/avr/drivers/audio_pwm_hardware.c
index df03a4558c..78776ee48a 100644
--- a/platforms/avr/drivers/audio_pwm_hardware.c
+++ b/platforms/avr/drivers/audio_pwm_hardware.c
@@ -152,7 +152,7 @@ extern uint8_t note_timbre;
#ifdef AUDIO1_PIN_SET
static float channel_1_frequency = 0.0f;
void channel_1_set_frequency(float freq) {
- if (freq == 0.0f) // a pause/rest is a valid "note" with freq=0
+ if (freq == 0.0f) // a pause/rest is a valid "note" with freq=0
{
// disable the output, but keep the pwm-ISR going (with the previous
// frequency) so the audio-state keeps getting updated
@@ -160,7 +160,7 @@ void channel_1_set_frequency(float freq) {
AUDIO1_TCCRxA &= ~(_BV(AUDIO1_COMxy1) | _BV(AUDIO1_COMxy0));
return;
} else {
- AUDIO1_TCCRxA |= _BV(AUDIO1_COMxy1); // enable output, PWM mode
+ AUDIO1_TCCRxA |= _BV(AUDIO1_COMxy1); // enable output, PWM mode
}
channel_1_frequency = freq;
@@ -202,7 +202,9 @@ void channel_2_set_frequency(float freq) {
AUDIO2_OCRxy = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre / 100);
}
-float channel_2_get_frequency(void) { return channel_2_frequency; }
+float channel_2_get_frequency(void) {
+ return channel_2_frequency;
+}
void channel_2_start(void) {
AUDIO2_TIMSKx |= _BV(AUDIO2_OCIExy);
diff --git a/platforms/avr/drivers/glcdfont.c b/platforms/avr/drivers/glcdfont.c
index 5e763b054f..57a21965de 100644
--- a/platforms/avr/drivers/glcdfont.c
+++ b/platforms/avr/drivers/glcdfont.c
@@ -10,14 +10,14 @@ static const unsigned char font[] PROGMEM = {
0x30, 0x38, 0x3E, 0x38, 0x30, 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x07, 0x00, 0x07, 0x00, 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x23, 0x13, 0x08, 0x64, 0x62, 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, 0x41, 0x22, 0x1C, 0x00, 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, 0x80, 0x70, 0x30, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x60, 0x60, 0x00, 0x20, 0x10, 0x08, 0x04, 0x02, 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, 0x42, 0x7F, 0x40, 0x00, 0x72, 0x49, 0x49, 0x49, 0x46, 0x21, 0x41, 0x49, 0x4D, 0x33, 0x18, 0x14, 0x12, 0x7F, 0x10, 0x27, 0x45, 0x45, 0x45, 0x39, 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x41, 0x21, 0x11, 0x09, 0x07, 0x36, 0x49, 0x49, 0x49, 0x36, 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x40, 0x34, 0x00, 0x00,
0x00, 0x08, 0x14, 0x22, 0x41, 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, 0x41, 0x22, 0x14, 0x08, 0x02, 0x01, 0x59, 0x09, 0x06, 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x7F, 0x49, 0x49, 0x49, 0x36, 0x3E, 0x41, 0x41, 0x41, 0x22, 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x7F, 0x49, 0x49, 0x49, 0x41, 0x7F, 0x09, 0x09, 0x09, 0x01, 0x3E, 0x41, 0x41, 0x51, 0x73, 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, 0x41, 0x7F, 0x41, 0x00, 0x20, 0x40, 0x41, 0x3F, 0x01, 0x7F, 0x08, 0x14, 0x22, 0x41, 0x7F, 0x40, 0x40, 0x40, 0x40, 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x7F, 0x09, 0x09, 0x09, 0x06, 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x7F, 0x09, 0x19, 0x29, 0x46, 0x26, 0x49, 0x49, 0x49, 0x32, 0x03, 0x01, 0x7F, 0x01, 0x03, 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x63, 0x14, 0x08, 0x14, 0x63, 0x03, 0x04, 0x78, 0x04, 0x03,
0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, 0x7F, 0x41, 0x41, 0x41, 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, 0x41, 0x41, 0x41, 0x7F, 0x04, 0x02, 0x01, 0x02, 0x04, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x03, 0x07, 0x08, 0x00, 0x20, 0x54, 0x54, 0x78, 0x40, 0x7F, 0x28, 0x44, 0x44, 0x38, 0x38, 0x44, 0x44, 0x44, 0x28, 0x38, 0x44, 0x44, 0x28, 0x7F, 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, 0x08, 0x7E, 0x09, 0x02, 0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, 0x44, 0x7D, 0x40, 0x00, 0x20, 0x40, 0x40, 0x3D, 0x00, 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, 0x41, 0x7F, 0x40, 0x00, 0x7C, 0x04, 0x78, 0x04, 0x78, 0x7C, 0x08, 0x04, 0x04, 0x78, 0x38, 0x44, 0x44, 0x44, 0x38, 0xFC, 0x18, 0x24, 0x24, 0x18, 0x18, 0x24, 0x24, 0x18, 0xFC, 0x7C, 0x08, 0x04, 0x04, 0x08, 0x48, 0x54, 0x54, 0x54, 0x24, 0x04, 0x04, 0x3F, 0x44, 0x24, 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x3C, 0x40, 0x30, 0x40, 0x3C,
- 0x44, 0x28, 0x10, 0x28, 0x44, 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x41, 0x36, 0x08, 0x00, 0x02, 0x01, 0x02, 0x04, 0x02, 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x1E, 0xA1, 0xA1, 0x61, 0x12, 0x3A, 0x40, 0x40, 0x20, 0x7A, 0x38, 0x54, 0x54, 0x55, 0x59, 0x21, 0x55, 0x55, 0x79, 0x41, 0x22, 0x54, 0x54, 0x78, 0x42, // a-umlaut
- 0x21, 0x55, 0x54, 0x78, 0x40, 0x20, 0x54, 0x55, 0x79, 0x40, 0x0C, 0x1E, 0x52, 0x72, 0x12, 0x39, 0x55, 0x55, 0x55, 0x59, 0x39, 0x54, 0x54, 0x54, 0x59, 0x39, 0x55, 0x54, 0x54, 0x58, 0x00, 0x00, 0x45, 0x7C, 0x41, 0x00, 0x02, 0x45, 0x7D, 0x42, 0x00, 0x01, 0x45, 0x7C, 0x40, 0x7D, 0x12, 0x11, 0x12, 0x7D, // A-umlaut
- 0xF0, 0x28, 0x25, 0x28, 0xF0, 0x7C, 0x54, 0x55, 0x45, 0x00, 0x20, 0x54, 0x54, 0x7C, 0x54, 0x7C, 0x0A, 0x09, 0x7F, 0x49, 0x32, 0x49, 0x49, 0x49, 0x32, 0x3A, 0x44, 0x44, 0x44, 0x3A, // o-umlaut
- 0x32, 0x4A, 0x48, 0x48, 0x30, 0x3A, 0x41, 0x41, 0x21, 0x7A, 0x3A, 0x42, 0x40, 0x20, 0x78, 0x00, 0x9D, 0xA0, 0xA0, 0x7D, 0x3D, 0x42, 0x42, 0x42, 0x3D, // O-umlaut
- 0x3D, 0x40, 0x40, 0x40, 0x3D, 0x3C, 0x24, 0xFF, 0x24, 0x24, 0x48, 0x7E, 0x49, 0x43, 0x66, 0x2B, 0x2F, 0xFC, 0x2F, 0x2B, 0xFF, 0x09, 0x29, 0xF6, 0x20, 0xC0, 0x88, 0x7E, 0x09, 0x03, 0x20, 0x54, 0x54, 0x79, 0x41, 0x00, 0x00, 0x44, 0x7D, 0x41, 0x30, 0x48, 0x48, 0x4A, 0x32, 0x38, 0x40, 0x40, 0x22, 0x7A, 0x00, 0x7A, 0x0A, 0x0A, 0x72, 0x7D, 0x0D, 0x19, 0x31, 0x7D, 0x26, 0x29, 0x29, 0x2F, 0x28, 0x26, 0x29, 0x29, 0x29, 0x26, 0x30, 0x48, 0x4D, 0x40, 0x20, 0x38, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x38, 0x2F, 0x10, 0xC8, 0xAC, 0xBA, 0x2F, 0x10, 0x28, 0x34, 0xFA, 0x00, 0x00, 0x7B, 0x00, 0x00, 0x08, 0x14, 0x2A, 0x14, 0x22, 0x22, 0x14, 0x2A, 0x14, 0x08, 0x55, 0x00, 0x55, 0x00, 0x55, // #176 (25% block) missing in old code
- 0xAA, 0x55, 0xAA, 0x55, 0xAA, // 50% block
- 0xFF, 0x55, 0xFF, 0x55, 0xFF, // 75% block
+ 0x44, 0x28, 0x10, 0x28, 0x44, 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x41, 0x36, 0x08, 0x00, 0x02, 0x01, 0x02, 0x04, 0x02, 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x1E, 0xA1, 0xA1, 0x61, 0x12, 0x3A, 0x40, 0x40, 0x20, 0x7A, 0x38, 0x54, 0x54, 0x55, 0x59, 0x21, 0x55, 0x55, 0x79, 0x41, 0x22, 0x54, 0x54, 0x78, 0x42, // a-umlaut
+ 0x21, 0x55, 0x54, 0x78, 0x40, 0x20, 0x54, 0x55, 0x79, 0x40, 0x0C, 0x1E, 0x52, 0x72, 0x12, 0x39, 0x55, 0x55, 0x55, 0x59, 0x39, 0x54, 0x54, 0x54, 0x59, 0x39, 0x55, 0x54, 0x54, 0x58, 0x00, 0x00, 0x45, 0x7C, 0x41, 0x00, 0x02, 0x45, 0x7D, 0x42, 0x00, 0x01, 0x45, 0x7C, 0x40, 0x7D, 0x12, 0x11, 0x12, 0x7D, // A-umlaut
+ 0xF0, 0x28, 0x25, 0x28, 0xF0, 0x7C, 0x54, 0x55, 0x45, 0x00, 0x20, 0x54, 0x54, 0x7C, 0x54, 0x7C, 0x0A, 0x09, 0x7F, 0x49, 0x32, 0x49, 0x49, 0x49, 0x32, 0x3A, 0x44, 0x44, 0x44, 0x3A, // o-umlaut
+ 0x32, 0x4A, 0x48, 0x48, 0x30, 0x3A, 0x41, 0x41, 0x21, 0x7A, 0x3A, 0x42, 0x40, 0x20, 0x78, 0x00, 0x9D, 0xA0, 0xA0, 0x7D, 0x3D, 0x42, 0x42, 0x42, 0x3D, // O-umlaut
+ 0x3D, 0x40, 0x40, 0x40, 0x3D, 0x3C, 0x24, 0xFF, 0x24, 0x24, 0x48, 0x7E, 0x49, 0x43, 0x66, 0x2B, 0x2F, 0xFC, 0x2F, 0x2B, 0xFF, 0x09, 0x29, 0xF6, 0x20, 0xC0, 0x88, 0x7E, 0x09, 0x03, 0x20, 0x54, 0x54, 0x79, 0x41, 0x00, 0x00, 0x44, 0x7D, 0x41, 0x30, 0x48, 0x48, 0x4A, 0x32, 0x38, 0x40, 0x40, 0x22, 0x7A, 0x00, 0x7A, 0x0A, 0x0A, 0x72, 0x7D, 0x0D, 0x19, 0x31, 0x7D, 0x26, 0x29, 0x29, 0x2F, 0x28, 0x26, 0x29, 0x29, 0x29, 0x26, 0x30, 0x48, 0x4D, 0x40, 0x20, 0x38, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x38, 0x2F, 0x10, 0xC8, 0xAC, 0xBA, 0x2F, 0x10, 0x28, 0x34, 0xFA, 0x00, 0x00, 0x7B, 0x00, 0x00, 0x08, 0x14, 0x2A, 0x14, 0x22, 0x22, 0x14, 0x2A, 0x14, 0x08, 0x55, 0x00, 0x55, 0x00, 0x55, // #176 (25% block) missing in old code
+ 0xAA, 0x55, 0xAA, 0x55, 0xAA, // 50% block
+ 0xFF, 0x55, 0xFF, 0x55, 0xFF, // 75% block
0x00, 0x00, 0x00, 0xFF, 0x00, 0x10, 0x10, 0x10, 0xFF, 0x00, 0x14, 0x14, 0x14, 0xFF, 0x00, 0x10, 0x10, 0xFF, 0x00, 0xFF, 0x10, 0x10, 0xF0, 0x10, 0xF0, 0x14, 0x14, 0x14, 0xFC, 0x00, 0x14, 0x14, 0xF7, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x14, 0x14, 0xF4, 0x04, 0xFC, 0x14, 0x14, 0x17, 0x10, 0x1F, 0x10, 0x10, 0x1F, 0x10, 0x1F, 0x14, 0x14, 0x14, 0x1F, 0x00, 0x10, 0x10, 0x10, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x10, 0x10, 0x10, 0x10, 0x1F, 0x10, 0x10, 0x10, 0x10, 0xF0, 0x10, 0x00, 0x00, 0x00, 0xFF, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xFF, 0x10, 0x00, 0x00, 0x00, 0xFF, 0x14, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x1F, 0x10, 0x17, 0x00, 0x00, 0xFC, 0x04, 0xF4, 0x14, 0x14, 0x17, 0x10, 0x17, 0x14, 0x14, 0xF4, 0x04, 0xF4, 0x00, 0x00, 0xFF, 0x00, 0xF7, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0xF7, 0x00, 0xF7, 0x14, 0x14, 0x14, 0x17, 0x14, 0x10, 0x10, 0x1F, 0x10, 0x1F,
- 0x14, 0x14, 0x14, 0xF4, 0x14, 0x10, 0x10, 0xF0, 0x10, 0xF0, 0x00, 0x00, 0x1F, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x1F, 0x14, 0x00, 0x00, 0x00, 0xFC, 0x14, 0x00, 0x00, 0xF0, 0x10, 0xF0, 0x10, 0x10, 0xFF, 0x10, 0xFF, 0x14, 0x14, 0x14, 0xFF, 0x14, 0x10, 0x10, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x38, 0x44, 0x44, 0x38, 0x44, 0xFC, 0x4A, 0x4A, 0x4A, 0x34, // sharp-s or beta
- 0x7E, 0x02, 0x02, 0x06, 0x06, 0x02, 0x7E, 0x02, 0x7E, 0x02, 0x63, 0x55, 0x49, 0x41, 0x63, 0x38, 0x44, 0x44, 0x3C, 0x04, 0x40, 0x7E, 0x20, 0x1E, 0x20, 0x06, 0x02, 0x7E, 0x02, 0x02, 0x99, 0xA5, 0xE7, 0xA5, 0x99, 0x1C, 0x2A, 0x49, 0x2A, 0x1C, 0x4C, 0x72, 0x01, 0x72, 0x4C, 0x30, 0x4A, 0x4D, 0x4D, 0x30, 0x30, 0x48, 0x78, 0x48, 0x30, 0xBC, 0x62, 0x5A, 0x46, 0x3D, 0x3E, 0x49, 0x49, 0x49, 0x00, 0x7E, 0x01, 0x01, 0x01, 0x7E, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x44, 0x44, 0x5F, 0x44, 0x44, 0x40, 0x51, 0x4A, 0x44, 0x40, 0x40, 0x44, 0x4A, 0x51, 0x40, 0x00, 0x00, 0xFF, 0x01, 0x03, 0xE0, 0x80, 0xFF, 0x00, 0x00, 0x08, 0x08, 0x6B, 0x6B, 0x08, 0x36, 0x12, 0x36, 0x24, 0x36, 0x06, 0x0F, 0x09, 0x0F, 0x06, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x30, 0x40, 0xFF, 0x01, 0x01, 0x00, 0x1F, 0x01, 0x01, 0x1E, 0x00, 0x19, 0x1D, 0x17, 0x12, 0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00 // #255 NBSP
+ 0x14, 0x14, 0x14, 0xF4, 0x14, 0x10, 0x10, 0xF0, 0x10, 0xF0, 0x00, 0x00, 0x1F, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x1F, 0x14, 0x00, 0x00, 0x00, 0xFC, 0x14, 0x00, 0x00, 0xF0, 0x10, 0xF0, 0x10, 0x10, 0xFF, 0x10, 0xFF, 0x14, 0x14, 0x14, 0xFF, 0x14, 0x10, 0x10, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x38, 0x44, 0x44, 0x38, 0x44, 0xFC, 0x4A, 0x4A, 0x4A, 0x34, // sharp-s or beta
+ 0x7E, 0x02, 0x02, 0x06, 0x06, 0x02, 0x7E, 0x02, 0x7E, 0x02, 0x63, 0x55, 0x49, 0x41, 0x63, 0x38, 0x44, 0x44, 0x3C, 0x04, 0x40, 0x7E, 0x20, 0x1E, 0x20, 0x06, 0x02, 0x7E, 0x02, 0x02, 0x99, 0xA5, 0xE7, 0xA5, 0x99, 0x1C, 0x2A, 0x49, 0x2A, 0x1C, 0x4C, 0x72, 0x01, 0x72, 0x4C, 0x30, 0x4A, 0x4D, 0x4D, 0x30, 0x30, 0x48, 0x78, 0x48, 0x30, 0xBC, 0x62, 0x5A, 0x46, 0x3D, 0x3E, 0x49, 0x49, 0x49, 0x00, 0x7E, 0x01, 0x01, 0x01, 0x7E, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x44, 0x44, 0x5F, 0x44, 0x44, 0x40, 0x51, 0x4A, 0x44, 0x40, 0x40, 0x44, 0x4A, 0x51, 0x40, 0x00, 0x00, 0xFF, 0x01, 0x03, 0xE0, 0x80, 0xFF, 0x00, 0x00, 0x08, 0x08, 0x6B, 0x6B, 0x08, 0x36, 0x12, 0x36, 0x24, 0x36, 0x06, 0x0F, 0x09, 0x0F, 0x06, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x30, 0x40, 0xFF, 0x01, 0x01, 0x00, 0x1F, 0x01, 0x01, 0x1E, 0x00, 0x19, 0x1D, 0x17, 0x12, 0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00 // #255 NBSP
};
diff --git a/platforms/avr/drivers/hd44780.c b/platforms/avr/drivers/hd44780.c
index f71069dece..f15d7d0da8 100644
--- a/platforms/avr/drivers/hd44780.c
+++ b/platforms/avr/drivers/hd44780.c
@@ -262,7 +262,7 @@ static uint8_t lcd_waitbusy(void)
delay(LCD_DELAY_BUSY_FLAG);
/* now read the address counter */
- return (lcd_read(0)); // return address counter
+ return (lcd_read(0)); // return address counter
} /* lcd_waitbusy */
@@ -362,17 +362,23 @@ void lcd_gotoxy(uint8_t x, uint8_t y) {
/*************************************************************************
*************************************************************************/
-int lcd_getxy(void) { return lcd_waitbusy(); }
+int lcd_getxy(void) {
+ return lcd_waitbusy();
+}
/*************************************************************************
Clear display and set cursor to home position
*************************************************************************/
-void lcd_clrscr(void) { lcd_command(1 << LCD_CLR); }
+void lcd_clrscr(void) {
+ lcd_command(1 << LCD_CLR);
+}
/*************************************************************************
Set cursor to home position
*************************************************************************/
-void lcd_home(void) { lcd_command(1 << LCD_HOME); }
+void lcd_home(void) {
+ lcd_command(1 << LCD_HOME);
+}
/*************************************************************************
Display character at current cursor position
@@ -382,7 +388,7 @@ Returns: none
void lcd_putc(char c) {
uint8_t pos;
- pos = lcd_waitbusy(); // read busy-flag and address counter
+ pos = lcd_waitbusy(); // read busy-flag and address counter
if (c == '\n') {
lcd_newline(pos);
} else {
@@ -483,8 +489,8 @@ void lcd_init(uint8_t dispAttr) {
delay(LCD_DELAY_BOOTUP); /* wait 16ms or more after power-on */
/* initial write to lcd is 8bit */
- LCD_DATA1_PORT |= _BV(LCD_DATA1_PIN); // LCD_FUNCTION>>4;
- LCD_DATA0_PORT |= _BV(LCD_DATA0_PIN); // LCD_FUNCTION_8BIT>>4;
+ LCD_DATA1_PORT |= _BV(LCD_DATA1_PIN); // LCD_FUNCTION>>4;
+ LCD_DATA0_PORT |= _BV(LCD_DATA0_PIN); // LCD_FUNCTION_8BIT>>4;
lcd_e_toggle();
delay(LCD_DELAY_INIT); /* delay, busy flag can't be checked here */
@@ -497,7 +503,7 @@ void lcd_init(uint8_t dispAttr) {
delay(LCD_DELAY_INIT_REP); /* delay, busy flag can't be checked here */
/* now configure for 4bit mode */
- LCD_DATA0_PORT &= ~_BV(LCD_DATA0_PIN); // LCD_FUNCTION_4BIT_1LINE>>4
+ LCD_DATA0_PORT &= ~_BV(LCD_DATA0_PIN); // LCD_FUNCTION_4BIT_1LINE>>4
lcd_e_toggle();
delay(LCD_DELAY_INIT_4BIT); /* some displays need this additional delay */
diff --git a/platforms/avr/drivers/i2c_master.c b/platforms/avr/drivers/i2c_master.c
index d4024378ca..c1a7b5f72d 100644
--- a/platforms/avr/drivers/i2c_master.c
+++ b/platforms/avr/drivers/i2c_master.c
@@ -25,12 +25,12 @@
#include "wait.h"
#ifndef F_SCL
-# define F_SCL 400000UL // SCL frequency
+# define F_SCL 400000UL // SCL frequency
#endif
#ifndef I2C_START_RETRY_COUNT
# define I2C_START_RETRY_COUNT 20
-#endif // I2C_START_RETRY_COUNT
+#endif // I2C_START_RETRY_COUNT
#define I2C_ACTION_READ 0x01
#define I2C_ACTION_WRITE 0x00
@@ -98,7 +98,7 @@ static i2c_status_t i2c_start_impl(uint8_t address, uint16_t timeout) {
i2c_status_t i2c_start(uint8_t address, uint16_t timeout) {
// Retry i2c_start_impl a bunch times in case the remote side has interrupts disabled.
uint16_t timeout_timer = timer_read();
- uint16_t time_slice = MAX(1, (timeout == (I2C_TIMEOUT_INFINITE)) ? 5 : (timeout / (I2C_START_RETRY_COUNT))); // if it's infinite, wait 1ms between attempts, otherwise split up the entire timeout into the number of retries
+ uint16_t time_slice = MAX(1, (timeout == (I2C_TIMEOUT_INFINITE)) ? 5 : (timeout / (I2C_START_RETRY_COUNT))); // if it's infinite, wait 1ms between attempts, otherwise split up the entire timeout into the number of retries
i2c_status_t status;
do {
status = i2c_start_impl(address, time_slice);
diff --git a/platforms/avr/drivers/i2c_slave.c b/platforms/avr/drivers/i2c_slave.c
index 2907f164c0..660d271be2 100644
--- a/platforms/avr/drivers/i2c_slave.c
+++ b/platforms/avr/drivers/i2c_slave.c
@@ -29,7 +29,7 @@
# include "transactions.h"
static volatile bool is_callback_executor = false;
-#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
+#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
volatile uint8_t i2c_slave_reg[I2C_SLAVE_REG_COUNT];
@@ -57,7 +57,7 @@ ISR(TWI_vect) {
slave_has_register_set = false;
#if defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
is_callback_executor = false;
-#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
+#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
break;
case TW_SR_DATA_ACK:
@@ -66,16 +66,16 @@ ISR(TWI_vect) {
if (!slave_has_register_set) {
buffer_address = TWDR;
- if (buffer_address >= I2C_SLAVE_REG_COUNT) { // address out of bounds dont ack
+ if (buffer_address >= I2C_SLAVE_REG_COUNT) { // address out of bounds dont ack
ack = 0;
buffer_address = 0;
}
- slave_has_register_set = true; // address has been received now fill in buffer
+ slave_has_register_set = true; // address has been received now fill in buffer
#if defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
// Work out if we're attempting to execute a callback
is_callback_executor = buffer_address == split_transaction_table[I2C_EXECUTE_CALLBACK].initiator2target_offset;
-#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
+#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
} else {
i2c_slave_reg[buffer_address] = TWDR;
buffer_address++;
@@ -88,7 +88,7 @@ ISR(TWI_vect) {
trans->slave_callback(trans->initiator2target_buffer_size, split_trans_initiator2target_buffer(trans), trans->target2initiator_buffer_size, split_trans_target2initiator_buffer(trans));
}
}
-#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
+#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
}
break;
diff --git a/platforms/avr/drivers/i2c_slave.h b/platforms/avr/drivers/i2c_slave.h
index a8647c9da3..178b6a29df 100644
--- a/platforms/avr/drivers/i2c_slave.h
+++ b/platforms/avr/drivers/i2c_slave.h
@@ -27,11 +27,11 @@
# if defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
# include "transport.h"
# define I2C_SLAVE_REG_COUNT sizeof(split_shared_memory_t)
-# else // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
+# else // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
# define I2C_SLAVE_REG_COUNT 30
-# endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
+# endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
-#endif // I2C_SLAVE_REG_COUNT
+#endif // I2C_SLAVE_REG_COUNT
_Static_assert(I2C_SLAVE_REG_COUNT < 256, "I2C target registers must be single byte");
diff --git a/platforms/avr/drivers/ps2/ps2_io.c b/platforms/avr/drivers/ps2/ps2_io.c
index 7c826fbf1a..b75a1ab0be 100644
--- a/platforms/avr/drivers/ps2/ps2_io.c
+++ b/platforms/avr/drivers/ps2/ps2_io.c
@@ -23,7 +23,9 @@ void clock_lo(void) {
setPinOutput(PS2_CLOCK_PIN);
}
-void clock_hi(void) { setPinInputHigh(PS2_CLOCK_PIN); }
+void clock_hi(void) {
+ setPinInputHigh(PS2_CLOCK_PIN);
+}
bool clock_in(void) {
setPinInputHigh(PS2_CLOCK_PIN);
@@ -42,7 +44,9 @@ void data_lo(void) {
setPinOutput(PS2_DATA_PIN);
}
-void data_hi(void) { setPinInputHigh(PS2_DATA_PIN); }
+void data_hi(void) {
+ setPinInputHigh(PS2_DATA_PIN);
+}
bool data_in(void) {
setPinInputHigh(PS2_DATA_PIN);
diff --git a/platforms/avr/drivers/ps2/ps2_usart.c b/platforms/avr/drivers/ps2/ps2_usart.c
index 151cfcd68f..39ec930d4a 100644
--- a/platforms/avr/drivers/ps2/ps2_usart.c
+++ b/platforms/avr/drivers/ps2/ps2_usart.c
@@ -76,7 +76,7 @@ static inline bool pbuf_has_data(void);
static inline void pbuf_clear(void);
void ps2_host_init(void) {
- idle(); // without this many USART errors occur when cable is disconnected
+ idle(); // without this many USART errors occur when cable is disconnected
PS2_USART_INIT();
PS2_USART_RX_INT_ON();
// POR(150-2000ms) plus BAT(300-500ms) may take 2.5sec([3]p.20)
@@ -91,12 +91,12 @@ uint8_t ps2_host_send(uint8_t data) {
/* terminate a transmission if we have */
inhibit();
- _delay_us(100); // [4]p.13
+ _delay_us(100); // [4]p.13
/* 'Request to Send' and Start bit */
data_lo();
clock_hi();
- WAIT(clock_lo, 10000, 10); // 10ms [5]p.50
+ WAIT(clock_lo, 10000, 10); // 10ms [5]p.50
/* Data bit[2-9] */
for (uint8_t i = 0; i < 8; i++) {
@@ -165,7 +165,7 @@ uint8_t ps2_host_recv(void) {
ISR(PS2_USART_RX_VECT) {
// TODO: request RESEND when error occurs?
- uint8_t error = PS2_USART_ERROR; // USART error should be read before data
+ uint8_t error = PS2_USART_ERROR; // USART error should be read before data
uint8_t data = PS2_USART_RX_DATA;
if (!error) {
pbuf_enqueue(data);
diff --git a/platforms/avr/drivers/serial.c b/platforms/avr/drivers/serial.c
index 62908e5875..6a36aa5f7f 100644
--- a/platforms/avr/drivers/serial.c
+++ b/platforms/avr/drivers/serial.c
@@ -156,59 +156,59 @@
# if SELECT_SOFT_SERIAL_SPEED == 0
// Very High speed
-# define SERIAL_DELAY 4 // micro sec
+# define SERIAL_DELAY 4 // micro sec
# if __GNUC__ < 6
-# define READ_WRITE_START_ADJUST 33 // cycles
-# define READ_WRITE_WIDTH_ADJUST 3 // cycles
+# define READ_WRITE_START_ADJUST 33 // cycles
+# define READ_WRITE_WIDTH_ADJUST 3 // cycles
# else
-# define READ_WRITE_START_ADJUST 34 // cycles
-# define READ_WRITE_WIDTH_ADJUST 7 // cycles
+# define READ_WRITE_START_ADJUST 34 // cycles
+# define READ_WRITE_WIDTH_ADJUST 7 // cycles
# endif
# elif SELECT_SOFT_SERIAL_SPEED == 1
// High speed
-# define SERIAL_DELAY 6 // micro sec
+# define SERIAL_DELAY 6 // micro sec
# if __GNUC__ < 6
-# define READ_WRITE_START_ADJUST 30 // cycles
-# define READ_WRITE_WIDTH_ADJUST 3 // cycles
+# define READ_WRITE_START_ADJUST 30 // cycles
+# define READ_WRITE_WIDTH_ADJUST 3 // cycles
# else
-# define READ_WRITE_START_ADJUST 33 // cycles
-# define READ_WRITE_WIDTH_ADJUST 7 // cycles
+# define READ_WRITE_START_ADJUST 33 // cycles
+# define READ_WRITE_WIDTH_ADJUST 7 // cycles
# endif
# elif SELECT_SOFT_SERIAL_SPEED == 2
// Middle speed
-# define SERIAL_DELAY 12 // micro sec
-# define READ_WRITE_START_ADJUST 30 // cycles
+# define SERIAL_DELAY 12 // micro sec
+# define READ_WRITE_START_ADJUST 30 // cycles
# if __GNUC__ < 6
-# define READ_WRITE_WIDTH_ADJUST 3 // cycles
+# define READ_WRITE_WIDTH_ADJUST 3 // cycles
# else
-# define READ_WRITE_WIDTH_ADJUST 7 // cycles
+# define READ_WRITE_WIDTH_ADJUST 7 // cycles
# endif
# elif SELECT_SOFT_SERIAL_SPEED == 3
// Low speed
-# define SERIAL_DELAY 24 // micro sec
-# define READ_WRITE_START_ADJUST 30 // cycles
+# define SERIAL_DELAY 24 // micro sec
+# define READ_WRITE_START_ADJUST 30 // cycles
# if __GNUC__ < 6
-# define READ_WRITE_WIDTH_ADJUST 3 // cycles
+# define READ_WRITE_WIDTH_ADJUST 3 // cycles
# else
-# define READ_WRITE_WIDTH_ADJUST 7 // cycles
+# define READ_WRITE_WIDTH_ADJUST 7 // cycles
# endif
# elif SELECT_SOFT_SERIAL_SPEED == 4
// Very Low speed
-# define SERIAL_DELAY 36 // micro sec
-# define READ_WRITE_START_ADJUST 30 // cycles
+# define SERIAL_DELAY 36 // micro sec
+# define READ_WRITE_START_ADJUST 30 // cycles
# if __GNUC__ < 6
-# define READ_WRITE_WIDTH_ADJUST 3 // cycles
+# define READ_WRITE_WIDTH_ADJUST 3 // cycles
# else
-# define READ_WRITE_WIDTH_ADJUST 7 // cycles
+# define READ_WRITE_WIDTH_ADJUST 7 // cycles
# endif
# elif SELECT_SOFT_SERIAL_SPEED == 5
// Ultra Low speed
-# define SERIAL_DELAY 48 // micro sec
-# define READ_WRITE_START_ADJUST 30 // cycles
+# define SERIAL_DELAY 48 // micro sec
+# define READ_WRITE_START_ADJUST 30 // cycles
# if __GNUC__ < 6
-# define READ_WRITE_WIDTH_ADJUST 3 // cycles
+# define READ_WRITE_WIDTH_ADJUST 3 // cycles
# else
-# define READ_WRITE_WIDTH_ADJUST 7 // cycles
+# define READ_WRITE_WIDTH_ADJUST 7 // cycles
# endif
# else
# error invalid SELECT_SOFT_SERIAL_SPEED value
@@ -223,29 +223,45 @@
# define SLAVE_INT_ACK_WIDTH 4
inline static void serial_delay(void) ALWAYS_INLINE;
-inline static void serial_delay(void) { _delay_us(SERIAL_DELAY); }
+inline static void serial_delay(void) {
+ _delay_us(SERIAL_DELAY);
+}
inline static void serial_delay_half1(void) ALWAYS_INLINE;
-inline static void serial_delay_half1(void) { _delay_us(SERIAL_DELAY_HALF1); }
+inline static void serial_delay_half1(void) {
+ _delay_us(SERIAL_DELAY_HALF1);
+}
inline static void serial_delay_half2(void) ALWAYS_INLINE;
-inline static void serial_delay_half2(void) { _delay_us(SERIAL_DELAY_HALF2); }
+inline static void serial_delay_half2(void) {
+ _delay_us(SERIAL_DELAY_HALF2);
+}
inline static void serial_output(void) ALWAYS_INLINE;
-inline static void serial_output(void) { setPinOutput(SOFT_SERIAL_PIN); }
+inline static void serial_output(void) {
+ setPinOutput(SOFT_SERIAL_PIN);
+}
// make the serial pin an input with pull-up resistor
inline static void serial_input_with_pullup(void) ALWAYS_INLINE;
-inline static void serial_input_with_pullup(void) { setPinInputHigh(SOFT_SERIAL_PIN); }
+inline static void serial_input_with_pullup(void) {
+ setPinInputHigh(SOFT_SERIAL_PIN);
+}
inline static uint8_t serial_read_pin(void) ALWAYS_INLINE;
-inline static uint8_t serial_read_pin(void) { return !!readPin(SOFT_SERIAL_PIN); }
+inline static uint8_t serial_read_pin(void) {
+ return !!readPin(SOFT_SERIAL_PIN);
+}
inline static void serial_low(void) ALWAYS_INLINE;
-inline static void serial_low(void) { writePinLow(SOFT_SERIAL_PIN); }
+inline static void serial_low(void) {
+ writePinLow(SOFT_SERIAL_PIN);
+}
inline static void serial_high(void) ALWAYS_INLINE;
-inline static void serial_high(void) { writePinHigh(SOFT_SERIAL_PIN); }
+inline static void serial_high(void) {
+ writePinHigh(SOFT_SERIAL_PIN);
+}
void soft_serial_initiator_init(void) {
serial_output();
@@ -286,7 +302,7 @@ static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) {
_delay_sub_us(READ_WRITE_START_ADJUST);
for (i = 0, byte = 0, p = PARITY; i < bit; i++) {
- serial_delay_half1(); // read the middle of pulses
+ serial_delay_half1(); // read the middle of pulses
if (serial_read_pin()) {
byte = (byte << 1) | 1;
p ^= 1;
@@ -298,7 +314,7 @@ static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) {
serial_delay_half2();
}
/* recive parity bit */
- serial_delay_half1(); // read the middle of pulses
+ serial_delay_half1(); // read the middle of pulses
pb = serial_read_pin();
_delay_sub_us(READ_WRITE_WIDTH_ADJUST);
serial_delay_half2();
@@ -330,7 +346,7 @@ void serial_write_chunk(uint8_t data, uint8_t bit) {
}
serial_delay();
- serial_low(); // sync_send() / senc_recv() need raise edge
+ serial_low(); // sync_send() / senc_recv() need raise edge
}
static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE;
@@ -356,19 +372,19 @@ static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) {
}
inline static void change_sender2reciver(void) {
- sync_send(); // 0
- serial_delay_half1(); // 1
- serial_low(); // 2
- serial_input_with_pullup(); // 2
- serial_delay_half1(); // 3
+ sync_send(); // 0
+ serial_delay_half1(); // 1
+ serial_low(); // 2
+ serial_input_with_pullup(); // 2
+ serial_delay_half1(); // 3
}
inline static void change_reciver2sender(void) {
- sync_recv(); // 0
- serial_delay(); // 1
- serial_low(); // 3
- serial_output(); // 3
- serial_delay_half1(); // 4
+ sync_recv(); // 0
+ serial_delay(); // 1
+ serial_low(); // 3
+ serial_output(); // 3
+ serial_delay_half1(); // 4
}
static inline uint8_t nibble_bits_count(uint8_t bits) {
@@ -391,11 +407,11 @@ ISR(SERIAL_PIN_INTERRUPT) {
}
serial_delay_half1();
- serial_high(); // response step1 low->high
+ serial_high(); // response step1 low->high
serial_output();
_delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT * SLAVE_INT_ACK_WIDTH);
split_transaction_desc_t *trans = &split_transaction_table[tid];
- serial_low(); // response step2 ack high->low
+ serial_low(); // response step2 ack high->low
// If the transaction has a callback, we can execute it now
if (trans->slave_callback) {
@@ -412,7 +428,7 @@ ISR(SERIAL_PIN_INTERRUPT) {
serial_recive_packet((uint8_t *)split_trans_initiator2target_buffer(trans), trans->initiator2target_buffer_size);
}
- sync_recv(); // weit initiator output to high
+ sync_recv(); // weit initiator output to high
}
/////////
diff --git a/platforms/avr/drivers/spi_master.c b/platforms/avr/drivers/spi_master.c
index 4e8fd3bcdf..ae9df03c02 100644
--- a/platforms/avr/drivers/spi_master.c
+++ b/platforms/avr/drivers/spi_master.c
@@ -125,7 +125,7 @@ spi_status_t spi_write(uint8_t data) {
}
spi_status_t spi_read() {
- SPDR = 0x00; // Dummy
+ SPDR = 0x00; // Dummy
uint16_t timeout_timer = timer_read();
while (!(SPSR & _BV(SPIF))) {
diff --git a/platforms/avr/drivers/ssd1306.c b/platforms/avr/drivers/ssd1306.c
index 1a09a2bcb7..7afbc09f00 100644
--- a/platforms/avr/drivers/ssd1306.c
+++ b/platforms/avr/drivers/ssd1306.c
@@ -161,7 +161,7 @@ bool iota_gfx_init(void) {
send_cmd1(DeActivateScroll);
send_cmd1(DisplayOn);
- send_cmd2(SetContrast, 0); // Dim
+ send_cmd2(SetContrast, 0); // Dim
clear_display();
@@ -226,7 +226,9 @@ void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) {
matrix_write_char_inner(matrix, c);
}
-void iota_gfx_write_char(uint8_t c) { matrix_write_char(&display, c); }
+void iota_gfx_write_char(uint8_t c) {
+ matrix_write_char(&display, c);
+}
void matrix_write(struct CharacterMatrix *matrix, const char *data) {
const char *end = data + strlen(data);
@@ -236,7 +238,9 @@ void matrix_write(struct CharacterMatrix *matrix, const char *data) {
}
}
-void iota_gfx_write(const char *data) { matrix_write(&display, data); }
+void iota_gfx_write(const char *data) {
+ matrix_write(&display, data);
+}
void matrix_write_P(struct CharacterMatrix *matrix, const char *data) {
while (true) {
@@ -249,7 +253,9 @@ void matrix_write_P(struct CharacterMatrix *matrix, const char *data) {
}
}
-void iota_gfx_write_P(const char *data) { matrix_write_P(&display, data); }
+void iota_gfx_write_P(const char *data) {
+ matrix_write_P(&display, data);
+}
void matrix_clear(struct CharacterMatrix *matrix) {
memset(matrix->display, ' ', sizeof(matrix->display));
@@ -257,7 +263,9 @@ void matrix_clear(struct CharacterMatrix *matrix) {
matrix->dirty = true;
}
-void iota_gfx_clear_screen(void) { matrix_clear(&display); }
+void iota_gfx_clear_screen(void) {
+ matrix_clear(&display);
+}
void matrix_render(struct CharacterMatrix *matrix) {
last_flush = timer_read();
@@ -301,7 +309,9 @@ done:
# endif
}
-void iota_gfx_flush(void) { matrix_render(&display); }
+void iota_gfx_flush(void) {
+ matrix_render(&display);
+}
__attribute__((weak)) void iota_gfx_task_user(void) {}
diff --git a/platforms/avr/drivers/uart.c b/platforms/avr/drivers/uart.c
index 01cf6b1fb8..fd5caf9a78 100644
--- a/platforms/avr/drivers/uart.c
+++ b/platforms/avr/drivers/uart.c
@@ -108,7 +108,7 @@ void uart_write(uint8_t data) {
// return immediately to avoid deadlock when interrupt is disabled(called from ISR)
if (tx_buffer_tail == i && (SREG & (1 << SREG_I)) == 0) return;
while (tx_buffer_tail == i)
- ; // wait until space in buffer
+ ; // wait until space in buffer
// cli();
tx_buffer[i] = data;
tx_buffer_head = i;
@@ -121,7 +121,7 @@ uint8_t uart_read(void) {
uint8_t data, i;
while (rx_buffer_head == rx_buffer_tail)
- ; // wait for character
+ ; // wait for character
i = rx_buffer_tail + 1;
if (i >= RX_BUFFER_SIZE) i = 0;
data = rx_buffer[i];
diff --git a/platforms/avr/drivers/ws2812.c b/platforms/avr/drivers/ws2812.c
index 9150b3c520..c461ab3ba7 100644
--- a/platforms/avr/drivers/ws2812.c
+++ b/platforms/avr/drivers/ws2812.c
@@ -110,7 +110,7 @@ static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t
asm volatile(" ldi %0,8 \n\t"
"loop%=: \n\t"
- " out %2,%3 \n\t" // '1' [01] '0' [01] - re
+ " out %2,%3 \n\t" // '1' [01] '0' [01] - re
#if (w1_nops & 1)
w_nop1
#endif
@@ -126,9 +126,9 @@ static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t
#if (w1_nops & 16)
w_nop16
#endif
- " sbrs %1,7 \n\t" // '1' [03] '0' [02]
- " out %2,%4 \n\t" // '1' [--] '0' [03] - fe-low
- " lsl %1 \n\t" // '1' [04] '0' [04]
+ " sbrs %1,7 \n\t" // '1' [03] '0' [02]
+ " out %2,%4 \n\t" // '1' [--] '0' [03] - fe-low
+ " lsl %1 \n\t" // '1' [04] '0' [04]
#if (w2_nops & 1)
w_nop1
#endif
@@ -144,7 +144,7 @@ static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t
#if (w2_nops & 16)
w_nop16
#endif
- " out %2,%4 \n\t" // '1' [+1] '0' [+1] - fe-high
+ " out %2,%4 \n\t" // '1' [+1] '0' [+1] - fe-high
#if (w3_nops & 1)
w_nop1
#endif
@@ -161,8 +161,8 @@ static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t
w_nop16
#endif
- " dec %0 \n\t" // '1' [+2] '0' [+2]
- " brne loop%=\n\t" // '1' [+3] '0' [+4]
+ " dec %0 \n\t" // '1' [+2] '0' [+2]
+ " brne loop%=\n\t" // '1' [+3] '0' [+4]
: "=&d"(ctr)
: "r"(curbyte), "I"(_SFR_IO_ADDR(PORTx_ADDRESS(RGB_DI_PIN))), "r"(maskhi), "r"(masklo));
}
diff --git a/platforms/avr/drivers/ws2812_i2c.c b/platforms/avr/drivers/ws2812_i2c.c
index 1c332e24b6..709f382254 100644
--- a/platforms/avr/drivers/ws2812_i2c.c
+++ b/platforms/avr/drivers/ws2812_i2c.c
@@ -13,7 +13,9 @@
# define WS2812_TIMEOUT 100
#endif
-void ws2812_init(void) { i2c_init(); }
+void ws2812_init(void) {
+ i2c_init();
+}
// Setleds for standard RGB
void ws2812_setleds(LED_TYPE *ledarray, uint16_t leds) {