   if (frame.get_byte(0) != SWM_ID)
     return;
 
-  lastHeartbeat = millis();
+  lastHeartbeat = currentMillis;
   
   // skip zero values 20 0 0 0 0 FF
   if (frame.get_byte(5) == 0xFF)


LinFrame frame = LinFrame();

unsigned long lastHeartbeat, lastBackDown, lastEnterDown, lastMouseDown;
int mouseSpeed = MOUSE_BASE_SPEED;

void setup() {

      if (!lastBackDown) 
        Keyboard.press(KEY_ESC); 
       
      lastBackDown = currentMillis;
      break;
      
    case NAV_ENTER:
      if (!lastEnterDown)
        Mouse.press(); 
      
      lastEnterDown = currentMillis;
      break;
  }
}

void move_mouse(int dx, int dy) {
  Mouse.move(dx * mouseSpeed, dy * mouseSpeed, 0); 
  lastMouseDown = currentMillis;
  mouseSpeed += MOUSE_SPEEDUP;
}

void release_keys() {
  if (lastEnterDown && currentMillis - lastEnterDown > KEY_TIMEOUT) {
    Mouse.release();
    lastEnterDown = 0;
  }
  
  if (lastBackDown && currentMillis - lastBackDown > KEY_TIMEOUT) {
    Keyboard.release(KEY_ESC);
    lastBackDown = 0;
  }

  if (lastMouseDown && currentMillis - lastMouseDown > KEY_TIMEOUT) { 
    lastMouseDown = 0;
    mouseSpeed = MOUSE_BASE_SPEED;
  }
}

void check_ignition_key() {
   if (lastHeartbeat && currentMillis - lastHeartbeat > HEARTBEAT_TIMEOUT) {
     lastHeartbeat = 0;
     turn_off();
   }
}

void turn_off() {
  Serial.println("TURN OFF");
}

// -- debugging

void dump_frame() {
  for (int i = 0; i < frame.num_bytes(); i++) {
