Skip to content

Commit

Permalink
Fix for issue #255 - fails to compile when single VFD spindle is sele…
Browse files Browse the repository at this point in the history
…cted.
  • Loading branch information
terjeio committed Feb 20, 2023
1 parent c2ba907 commit 881ed9d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions vfd/spindle.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ uint32_t vfd_get_modbus_address (spindle_id_t spindle_id)

#endif

#if N_SPINDLE_SELECTABLE > 1

static bool is_vfd_spindle (const setting_detail_t *setting)
{
uint_fast8_t idx = n_spindle;
Expand All @@ -167,6 +169,19 @@ static bool is_vfd_spindle (const setting_detail_t *setting)
return spindle && spindle->type == SpindleType_VFD;
}

#endif

#if VFD_ENABLE == SPINDLE_ALL || VFD_ENABLE == SPINDLE_MODVFD

#if N_SPINDLE == 1

static bool is_modvfd_selected (const setting_detail_t *setting)
{
return true;
}

#else

static bool is_modvfd_selected (const setting_detail_t *setting)
{
bool ok = false;
Expand All @@ -180,6 +195,21 @@ static bool is_modvfd_selected (const setting_detail_t *setting)
return ok;
}

#endif

#endif // VFD_ENABLE == SPINDLE_ALL || VFD_ENABLE == SPINDLE_MODVFD

#if VFD_ENABLE == SPINDLE_ALL || VFD_ENABLE == SPINDLE_GS20 || VFD_ENABLE == SPINDLE_YL620A

#if N_SPINDLE == 1

static bool is_ysgl_selected (const setting_detail_t *setting)
{
return true;
}

#else

static bool is_ysgl_selected (const setting_detail_t *setting)
{
bool ok = false;
Expand All @@ -193,6 +223,10 @@ static bool is_ysgl_selected (const setting_detail_t *setting)
return ok;
}

#endif

#endif // VFD_ENABLE == SPINDLE_ALL || VFD_ENABLE == SPINDLE_GS20 || VFD_ENABLE == SPINDLE_YL620A

static const setting_group_detail_t vfd_groups [] = {
{Group_Root, Group_VFD, "VFD"}
};
Expand Down

0 comments on commit 881ed9d

Please sign in to comment.