Skip to content

Commit

Permalink
bugfix in multitaster.c, bei adcValue 0 gab es einen ueberlauf. Taste…
Browse files Browse the repository at this point in the history
…r sendet dann falsche Gruppe
  • Loading branch information
RealMerlin committed Dec 11, 2018
1 parent c5bfa4c commit d13dd85
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion firmwares/controllerboard/devices/multitaster.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@ void multitaster_can_callback(device_data_multitaster *p,
{ {
if ( adcValue <= (i * p->oneScale) ) if ( adcValue <= (i * p->oneScale) )
{ {
p->lastPotiPos = i-1; //d.h. befindet sich bis zum (i-1). Skalenstrich if ( adcValue == 0 ) //d.h. befindet sich am unteren Anschlag
p->lastPotiPos = 0; //bei adcValue = 0 waere auch i = 0 und das wuerde zu lastPotiPos = 0-1 fuhren
else
p->lastPotiPos = i-1; //d.h. befindet sich bis zum (i-1). Skalenstrich

//canix_syslog_P(SYSLOG_PRIO_DEBUG, PSTR("PotiPos=%d"), p->lastPotiPos); //canix_syslog_P(SYSLOG_PRIO_DEBUG, PSTR("PotiPos=%d"), p->lastPotiPos);
break; //break die "for-Loop" break; //break die "for-Loop"
} }
Expand Down

0 comments on commit d13dd85

Please sign in to comment.