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>
This commit is contained in:
committed by
KevinOConnor
parent
7eda55e2b0
commit
b28e95ca1a
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "internal.h" // WDT
|
||||
#include "sched.h" // sched_main
|
||||
|
||||
DECL_CONSTANT(MCU, CONFIG_MCU);
|
||||
DECL_CONSTANT_STR("MCU", CONFIG_MCU);
|
||||
|
||||
|
||||
/****************************************************************
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user