File tree Expand file tree Collapse file tree
src/hal/user_comps/wj200_vfd Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -271,6 +271,7 @@ void userinit(int argc, char **argv)
271271void user_mainloop(void) {
272272 wj200_status status;
273273 uint16_t calculated_frequency;
274+ bool last_enable_state = FALSE;
274275
275276 while(1) {
276277 FOR_ALL_INSTS() {
@@ -297,10 +298,19 @@ void user_mainloop(void) {
297298 pin won't change until we make it all the way through
298299 the loop.
299300 */
300- if(!wj200_getStatus(ctx, &status)) {
301- print_modbus_error(__comp_inst, "failed to get status");
302- continue;
303- }
301+
302+ if(!wj200_getStatus(ctx, &status)) {
303+ /*
304+ Only want to list 'failed to get status' once
305+ any time enable changes - don't spam the output.
306+ A wink is as good as a nod.
307+ */
308+ if (last_enable_state != enable) {
309+ print_modbus_error(__comp_inst, "failed to get status");
310+ }
311+ last_enable_state = enable;
312+ continue;
313+ }
304314
305315 is_running = status.running;
306316 is_at_speed = status.at_speed;
You can’t perform that action at this time.
0 commit comments