Browse Source

Turn off USB keyboard idle reports

main
PaulStoffregen 7 years ago
parent
commit
3d918a3977
2 changed files with 8 additions and 0 deletions
  1. +2
    -0
      USBHost.h
  2. +6
    -0
      keyboard.cpp

+ 2
- 0
USBHost.h View File

void attachRelease(void (*keyReleased)()); void attachRelease(void (*keyReleased)());
protected: protected:
virtual bool claim(Device_t *device, int type, const uint8_t *descriptors, uint32_t len); virtual bool claim(Device_t *device, int type, const uint8_t *descriptors, uint32_t len);
virtual void control(const Transfer_t *transfer);
virtual void disconnect(); virtual void disconnect();
static void callback(const Transfer_t *transfer); static void callback(const Transfer_t *transfer);
void new_data(const Transfer_t *transfer); void new_data(const Transfer_t *transfer);
void (*keyPressedFunction)(); void (*keyPressedFunction)();
void (*keyReleasedFunction)(); void (*keyReleasedFunction)();
Pipe_t *datapipe; Pipe_t *datapipe;
setup_t setup;
uint8_t report[8]; uint8_t report[8];
}; };



+ 6
- 0
keyboard.cpp View File

datapipe = new_Pipe(dev, 3, endpoint, 1, 8, interval); datapipe = new_Pipe(dev, 3, endpoint, 1, 8, interval);
datapipe->callback_function = callback; datapipe->callback_function = callback;
queue_Data_Transfer(datapipe, report, 8, this); queue_Data_Transfer(datapipe, report, 8, this);
mk_setup(setup, 0x21, 10, 0, 0, 0); // 10=SET_IDLE
queue_Control_Transfer(dev, &setup, NULL, this);
return true; return true;
} }


void KeyboardController::control(const Transfer_t *transfer)
{
}

void KeyboardController::callback(const Transfer_t *transfer) void KeyboardController::callback(const Transfer_t *transfer)
{ {
println("KeyboardController Callback (static)"); println("KeyboardController Callback (static)");

Loading…
Cancel
Save