aboutsummaryrefslogtreecommitdiffstats
path: root/src/avr
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-03-04 23:35:11 -0500
committerKevinOConnor <kevin@koconnor.net>2019-03-17 19:38:18 -0400
commitb28e95ca1aa2860c0869041c29a3ba27054e5967 (patch)
treeb507c6a45c52fff68a449f20213d39b6bc8e4a29 /src/avr
parent7eda55e2b042566020ade34d7b2cdb9296f37f1d (diff)
downloadkutter-b28e95ca1aa2860c0869041c29a3ba27054e5967.tar.gz
kutter-b28e95ca1aa2860c0869041c29a3ba27054e5967.tar.xz
kutter-b28e95ca1aa2860c0869041c29a3ba27054e5967.zip
command: Always pass a string to the DECL_CONSTANT() macro
Make it clear that the name of the constant being defined is a string. When the value being defined is also a string, use a new DECL_CONSTANT_STR() macro. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/avr')
-rw-r--r--src/avr/adc.c2
-rw-r--r--src/avr/hard_pwm.c2
-rw-r--r--src/avr/main.c2
-rw-r--r--src/avr/timer.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/avr/adc.c b/src/avr/adc.c
index 3087dce1..8b478d08 100644
--- a/src/avr/adc.c
+++ b/src/avr/adc.c
@@ -36,7 +36,7 @@ static const uint8_t adc_pins[] PROGMEM = {
enum { ADMUX_DEFAULT = 0x40 };
enum { ADC_ENABLE = (1<<ADPS0)|(1<<ADPS1)|(1<<ADPS2)|(1<<ADEN)|(1<<ADIF) };
-DECL_CONSTANT(ADC_MAX, 1023);
+DECL_CONSTANT("ADC_MAX", 1023);
struct gpio_adc
gpio_adc_setup(uint8_t pin)
diff --git a/src/avr/hard_pwm.c b/src/avr/hard_pwm.c
index a6609313..01d0bd9e 100644
--- a/src/avr/hard_pwm.c
+++ b/src/avr/hard_pwm.c
@@ -74,7 +74,7 @@ static const struct gpio_pwm_info pwm_regs[] PROGMEM = {
#endif
};
-DECL_CONSTANT(PWM_MAX, 255);
+DECL_CONSTANT("PWM_MAX", 255);
struct gpio_pwm
gpio_pwm_setup(uint8_t pin, uint32_t cycle_time, uint8_t val)
diff --git a/src/avr/main.c b/src/avr/main.c
index 57aa3c01..0523af41 100644
--- a/src/avr/main.c
+++ b/src/avr/main.c
@@ -12,7 +12,7 @@
#include "irq.h" // irq_enable
#include "sched.h" // sched_main
-DECL_CONSTANT(MCU, CONFIG_MCU);
+DECL_CONSTANT_STR("MCU", CONFIG_MCU);
/****************************************************************
diff --git a/src/avr/timer.c b/src/avr/timer.c
index e8880a64..fb8738cc 100644
--- a/src/avr/timer.c
+++ b/src/avr/timer.c
@@ -16,7 +16,7 @@
* Low level timer code
****************************************************************/
-DECL_CONSTANT(CLOCK_FREQ, CONFIG_CLOCK_FREQ);
+DECL_CONSTANT("CLOCK_FREQ", CONFIG_CLOCK_FREQ);
// Return the number of clock ticks for a given number of microseconds
uint32_t