1
0

bluefruit, pjrc: Update protocols for new API

This commit is contained in:
tmk 2015-01-03 12:02:48 +09:00
parent c0880e5011
commit 9dd9deac04
4 changed files with 6 additions and 5 deletions

View File

@ -36,7 +36,7 @@ static void bluefruit_serial_send(uint8_t);
void bluefruit_keyboard_print_report(report_keyboard_t *report)
{
if (!debug_keyboard) return;
dprintf("keys: "); for (int i = 0; i < REPORT_KEYS; i++) { debug_hex8(report->keys[i]); dprintf(" "); }
dprintf("keys: "); for (int i = 0; i < KEYBOARD_REPORT_KEYS; i++) { debug_hex8(report->keys[i]); dprintf(" "); }
dprintf(" mods: "); debug_hex8(report->mods);
dprintf(" reserved: "); debug_hex8(report->reserved);
dprintf("\n");
@ -99,7 +99,7 @@ static void send_keyboard(report_keyboard_t *report)
bluefruit_trace_header();
#endif
bluefruit_serial_send(0xFD);
for (uint8_t i = 0; i < REPORT_SIZE; i++) {
for (uint8_t i = 0; i < KEYBOARD_REPORT_SIZE; i++) {
bluefruit_serial_send(report->raw[i]);
}
#ifdef BLUEFRUIT_TRACE_SERIAL

View File

@ -104,7 +104,7 @@ int main(void)
dprintf("Starting main loop");
while (1) {
while (suspend) {
suspend_power_down();
suspend_power_down(WDTO_120MS);
if (remote_wakeup && suspend_wakeup_condition()) {
usb_remote_wakeup();
}

View File

@ -24,6 +24,7 @@
#include <stdbool.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/wdt.h>
#include <util/delay.h>
#include "keyboard.h"
#include "usb.h"
@ -60,7 +61,7 @@ int main(void)
#endif
while (1) {
while (suspend) {
suspend_power_down();
suspend_power_down(WDTO_120MS);
if (remote_wakeup && suspend_wakeup_condition()) {
usb_remote_wakeup();
}

View File

@ -74,7 +74,7 @@ void usb_keyboard_print_report(report_keyboard_t *report)
{
if (!debug_keyboard) return;
print("keys: ");
for (int i = 0; i < REPORT_KEYS; i++) { phex(report->keys[i]); print(" "); }
for (int i = 0; i < KEYBOARD_REPORT_KEYS; i++) { phex(report->keys[i]); print(" "); }
print(" mods: "); phex(report->mods); print("\n");
}