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
@@ -13,7 +13,7 @@
|
||||
#include "internal.h" // report_errno
|
||||
#include "sched.h" // sched_shutdown
|
||||
|
||||
DECL_CONSTANT(ADC_MAX, 4095); // Assume 12bit adc
|
||||
DECL_CONSTANT("ADC_MAX", 4095); // Assume 12bit adc
|
||||
|
||||
#define IIO_PATH "/sys/bus/iio/devices/iio:device0/in_voltage%d_raw"
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "internal.h" // console_setup
|
||||
#include "sched.h" // sched_main
|
||||
|
||||
DECL_CONSTANT(MCU, "linux");
|
||||
DECL_CONSTANT_STR("MCU", "linux");
|
||||
|
||||
|
||||
/****************************************************************
|
||||
|
||||
@@ -136,7 +136,7 @@ struct i2cpwm_s {
|
||||
uint32_t max_duration;
|
||||
};
|
||||
|
||||
DECL_CONSTANT(PCA9685_MAX, VALUE_MAX);
|
||||
DECL_CONSTANT("PCA9685_MAX", VALUE_MAX);
|
||||
|
||||
static uint_fast8_t
|
||||
pca9685_end_event(struct timer *timer)
|
||||
|
||||
@@ -106,7 +106,7 @@ timer_check_periodic(struct timespec *ts)
|
||||
* Timers
|
||||
****************************************************************/
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user