Skip to content

Commit bc24b7d

Browse files
committed
enum: Add enum to the Makefile
And fix a couple of warnings. Signed-off-by: andypugh <andy@bodgesoc.org>
1 parent 11eda9f commit bc24b7d

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,8 @@ obj-$(CONFIG_DEBOUNCE) += debounce.o
922922
debounce-objs := hal/components/debounce.o $(MATHSTUB)
923923
obj-$(CONFIG_ENCODER) += encoder.o
924924
encoder-objs := hal/components/encoder.o $(MATHSTUB)
925+
obj-$(CONFIG_ENUM) += enum.o
926+
enum-objs := hal/components/enum.o $(MATHSTUB)
925927
obj-$(CONFIG_COUNTER) += counter.o
926928
counter-objs := hal/components/counter.o $(MATHSTUB)
927929
obj-$(CONFIG_ENCODER_RATIO) += encoder_ratio.o
@@ -1267,6 +1269,7 @@ endif
12671269
../rtlib/boss_plc$(MODULE_EXT): $(addprefix objects/rt,$(boss_plc-objs))
12681270
../rtlib/debounce$(MODULE_EXT): $(addprefix objects/rt,$(debounce-objs))
12691271
../rtlib/encoder$(MODULE_EXT): $(addprefix objects/rt,$(encoder-objs))
1272+
../rtlib/enum$(MODULE_EXT): $(addprefix objects/rt,$(enum-objs))
12701273
../rtlib/counter$(MODULE_EXT): $(addprefix objects/rt,$(counter-objs))
12711274
../rtlib/encoder_ratio$(MODULE_EXT): $(addprefix objects/rt,$(encoder_ratio-objs))
12721275
../rtlib/stepgen$(MODULE_EXT): $(addprefix objects/rt,$(stepgen-objs))

src/Makefile.inc.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ CONFIG_BLOCKS=m
180180
CONFIG_BOSS_PLC=m
181181
CONFIG_DEBOUNCE=m
182182
CONFIG_ENCODER=m
183+
CONFIG_ENUM=m
183184
CONFIG_COUNTER=m
184185
CONFIG_ENCODER_RATIO=m
185186
CONFIG_STEPGEN=m

src/hal/components/enum.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ static void decode(void *inst, long period);
6565
static void encode(void *inst, long period);
6666

6767
int rtapi_app_main(void){
68-
int num_chans;
6968
int i, j, v;
7069
int retval;
7170
char *token;
@@ -191,7 +190,6 @@ int rtapi_app_main(void){
191190

192191
static void decode(void *v_inst, long period){;
193192
enum_inst_t *inst = v_inst;
194-
static int once = 0;
195193
for (int i = 1; i <= inst->num_pins; i++){
196194
if (*(inst->hal[0].en) == *(inst->hal[i].en)){
197195
*(inst->hal[i].bit) = 1;

0 commit comments

Comments
 (0)