diff --git a/docs/Protocol.md b/docs/Protocol.md index c6fce029..f73a195a 100644 --- a/docs/Protocol.md +++ b/docs/Protocol.md @@ -115,7 +115,7 @@ Declaring constants Constants can also be exported. For example, the following: ``` -DECL_CONSTANT(SERIAL_BAUD, 250000); +DECL_CONSTANT("SERIAL_BAUD", 250000); ``` would export a constant named "SERIAL_BAUD" with a value of 250000 diff --git a/src/atsam/adc.c b/src/atsam/adc.c index d5e74676..816b388e 100644 --- a/src/atsam/adc.c +++ b/src/atsam/adc.c @@ -27,7 +27,7 @@ static const uint8_t adc_pins[] = { }; #define ADC_FREQ_MAX 20000000 -DECL_CONSTANT(ADC_MAX, 4095); +DECL_CONSTANT("ADC_MAX", 4095); struct gpio_adc gpio_adc_setup(uint8_t pin) diff --git a/src/atsam/hard_pwm.c b/src/atsam/hard_pwm.c index 7d1881a6..0b238b24 100644 --- a/src/atsam/hard_pwm.c +++ b/src/atsam/hard_pwm.c @@ -54,7 +54,7 @@ static const struct gpio_pwm_info pwm_regs[] = { #define MAX_PWM 255 -DECL_CONSTANT(PWM_MAX, MAX_PWM); +DECL_CONSTANT("PWM_MAX", MAX_PWM); struct gpio_pwm gpio_pwm_setup(uint8_t pin, uint32_t cycle_time, uint8_t val) diff --git a/src/atsam/main.c b/src/atsam/main.c index b6be2864..0bb9ff83 100644 --- a/src/atsam/main.c +++ b/src/atsam/main.c @@ -10,7 +10,7 @@ #include "internal.h" // WDT #include "sched.h" // sched_main -DECL_CONSTANT(MCU, CONFIG_MCU); +DECL_CONSTANT_STR("MCU", CONFIG_MCU); /**************************************************************** diff --git a/src/atsam/sam4e_afec.c b/src/atsam/sam4e_afec.c index 002e092f..4c78e958 100644 --- a/src/atsam/sam4e_afec.c +++ b/src/atsam/sam4e_afec.c @@ -51,7 +51,7 @@ gpio_adc_to_afec_chan(struct gpio_adc g) } #define ADC_FREQ_MAX 6000000UL -DECL_CONSTANT(ADC_MAX, 4095); +DECL_CONSTANT("ADC_MAX", 4095); static int init_afec(Afec* afec) { diff --git a/src/atsamd/adc.c b/src/atsamd/adc.c index 26465c2d..8d25d2f4 100644 --- a/src/atsamd/adc.c +++ b/src/atsamd/adc.c @@ -37,7 +37,7 @@ static const uint8_t adc_pins[] = { }; #endif -DECL_CONSTANT(ADC_MAX, 4095); +DECL_CONSTANT("ADC_MAX", 4095); static struct gpio_adc gpio_adc_pin_to_struct(uint8_t pin) { diff --git a/src/atsamd/hard_pwm.c b/src/atsamd/hard_pwm.c index 3f510520..0b3a6ba4 100644 --- a/src/atsamd/hard_pwm.c +++ b/src/atsamd/hard_pwm.c @@ -41,7 +41,7 @@ static const struct gpio_pwm_info pwm_regs[] = { #define MAX_PWM 255 -DECL_CONSTANT(PWM_MAX, MAX_PWM); +DECL_CONSTANT("PWM_MAX", MAX_PWM); struct gpio_pwm gpio_pwm_setup(uint8_t pin, uint32_t cycle_time, uint8_t val) diff --git a/src/atsamd/main.c b/src/atsamd/main.c index 5a5a374d..c7dbe9fd 100644 --- a/src/atsamd/main.c +++ b/src/atsamd/main.c @@ -8,7 +8,7 @@ #include "internal.h" // NVIC_SystemReset #include "sched.h" // sched_main -DECL_CONSTANT(MCU, CONFIG_MCU); +DECL_CONSTANT_STR("MCU", CONFIG_MCU); // Return the start of memory available for dynamic allocations void * 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<