// Just deal with mice...
// This version gets rid of the serial output and just passes all mouse
// events through from host to computer.

#include "USBHost_t36.h"

USBHost myusb;
USBHIDParser hid(myusb);
MouseController mouse(myusb);

void ProcessMouseData() {
  uint32_t cur_buttons;
  int cur_x;
  int cur_y;
  int cur_wheel;
  int cur_wheelh;

  if (mouse.available()) {
    cur_buttons = mouse.getButtons();
    cur_x = mouse.getMouseX();
    cur_y = mouse.getMouseY();
    cur_wheel = mouse.getWheel();
    cur_wheelh = mouse.getWheelH();
    Mouse.mask_and_move(cur_buttons,cur_x,cur_y,cur_wheel,cur_wheelh);
    mouse.mouseDataClear();
  }
}

void setup()
{
  myusb.begin();
}

void loop()
{
  myusb.Task();
  ProcessMouseData();
}
