summaryrefslogtreecommitdiff
path: root/eq.c
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2020-01-04 19:13:56 -0800
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2020-01-04 19:13:56 -0800
commite01381a40290f1dcf8eb1ff467a621050f5a9948 (patch)
tree7420bc114eba77cfe45cfe40abdcbb26e564ddd6 /eq.c
parentfbd4c9cc4f101cf2dacb3521517facfbd36c41ac (diff)
downloadchristmas_lights-e01381a40290f1dcf8eb1ff467a621050f5a9948.tar.gz
christmas_lights-e01381a40290f1dcf8eb1ff467a621050f5a9948.tar.xz
consistent function braces
Diffstat (limited to 'eq.c')
-rw-r--r--eq.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/eq.c b/eq.c
index 846e1fa..a67274e 100644
--- a/eq.c
+++ b/eq.c
@@ -8,20 +8,23 @@ unsigned char eq_levels[7];
static const unsigned char thresholds[][2] = { EQ_THRESHOLDS };
-static void reset() {
+static void reset()
+{
PORTB |= (1 << EQ_PIN_RESET);
PORTB &= ~(1 << EQ_PIN_RESET);
_delay_us(36);
}
-static void strobe() {
+static void strobe()
+{
PORTB |= (1 << EQ_PIN_STROBE);
_delay_us(36);
PORTB &= ~(1 << EQ_PIN_STROBE);
_delay_us(36);
}
-static unsigned char map_level(unsigned char val, unsigned char min, unsigned char max) {
+static unsigned char map_level(unsigned char val, unsigned char min, unsigned char max)
+{
if (val <= min)
return 0;
else if (val >= max)
@@ -30,7 +33,8 @@ static unsigned char map_level(unsigned char val, unsigned char min, unsigned ch
return (val - min) * 255 / (max - min);
}
-void eq_read() {
+void eq_read()
+{
reset();
for (int i = 0; i < 7; ++i) {
@@ -42,7 +46,8 @@ void eq_read() {
}
}
-void eq_decay(int cycles) {
+void eq_decay(int cycles)
+{
for (int i = 0; i < cycles; ++i) {
reset();