From d3b1af9572e123c939fc355474bf12402c86d292 Mon Sep 17 00:00:00 2001 From: tmk Date: Thu, 30 Sep 2010 14:17:01 +0900 Subject: add mouse function. --- mykey.c | 127 +++++++++++++++++++++++++++------------------------------------- 1 file changed, 54 insertions(+), 73 deletions(-) (limited to 'mykey.c') diff --git a/mykey.c b/mykey.c index 94cbbfb5a1..a295b8c57d 100644 --- a/mykey.c +++ b/mykey.c @@ -30,7 +30,9 @@ #include #include -#include "usb_device.h" +#include "usb.h" +#include "usb_keyboard.h" +#include "usb_mouse.h" #include "print.h" #include "matrix.h" #include "keymap.h" @@ -50,16 +52,9 @@ uint16_t idle_count=0; int main(void) { - bool modified = false; - bool has_ghost = false; - uint8_t key_index = 0; - // set for 16 MHz clock CPU_PRESCALE(0); - matrix_init(); - - // Initialize the USB, and then wait for the host to set configuration. // If the Teensy is powered without a PC connected to the USB port, // this will wait forever. @@ -78,99 +73,85 @@ int main(void) TCCR0B = 0x05; TIMSK0 = (1< 6) { - //Rollover - } + // mouse + print("usb_mouse_move\n"); + usb_mouse_move(10, 0, 0); - usb_keyboard_send(); - - - // variables shared with interrupt routines must be - // accessed carefully so the interrupt routine doesn't - // try to use the variable in the middle of our access - cli(); - //idle_count = 0; - sei(); - } - - // print matrix state for debug - if (modified) { - print_matrix(); - - // LED flush - DDRD |= 1<> 8); phex(idle_count & 0xFF); print("\n"); - print("loop_count: "); phex((loop_count & 0xFF00) >> 8); phex(loop_count & 0xFF); print("\n"); - print_matrix(); - } - // teensy LED flush for debug - if ((loop_count & 0x100) == 0) { - DDRD |= 1< 6) { + //Rollover + } + usb_keyboard_send(); + } } -*/ - - // now the current pins will be the previous, and - // wait a short delay so we're not highly sensitive - // to mechanical "bounce". - _delay_ms(2); loop_count++; + _delay_ms(2); } } -- cgit v1.2.3