🐛 Fix and improve FTDI Eve Touch UI (#22361, #22439, #22459, #22468, #22500, #22530)

This commit is contained in:
Marcio T
2021-07-14 21:13:08 -06:00
committed by Scott Lahteine
parent 3924545912
commit 166324fc7b
45 changed files with 177 additions and 170 deletions

View File

@ -40,7 +40,7 @@ struct GpioEvent {
pin_type pin_id;
GpioEvent::Type event;
GpioEvent(uint64_t timestamp, pin_type pin_id, GpioEvent::Type event){
GpioEvent(uint64_t timestamp, pin_type pin_id, GpioEvent::Type event) {
this->timestamp = timestamp;
this->pin_id = pin_id;
this->event = event;

View File

@ -51,7 +51,7 @@ void LinearAxis::update() {
}
void LinearAxis::interrupt(GpioEvent ev) {
if (ev.pin_id == step_pin && !Gpio::pin_map[enable_pin].value){
if (ev.pin_id == step_pin && !Gpio::pin_map[enable_pin].value) {
if (ev.event == GpioEvent::RISE) {
last_update = ev.timestamp;
position += -1 + 2 * Gpio::pin_map[dir_pin].value;

View File

@ -52,7 +52,7 @@ public:
return (*(intptr_t*)timerid);
}
static void handler(int sig, siginfo_t *si, void *uc){
static void handler(int sig, siginfo_t *si, void *uc) {
Timer* _this = (Timer*)si->si_value.sival_ptr;
_this->avg_error += (Clock::nanos() - _this->start_time) - _this->period; //high_resolution_clock is also limited in precision, but best we have
_this->avg_error /= 2; //very crude precision analysis (actually within +-500ns usually)