File tree Expand file tree Collapse file tree 2 files changed +9
-16
lines changed
Expand file tree Collapse file tree 2 files changed +9
-16
lines changed Original file line number Diff line number Diff line change @@ -145,25 +145,18 @@ void clearMove() {
145145class DigiMouseDevice {
146146 public:
147147 DigiMouseDevice () {
148- // this timer stuff doesn't even make sense - it seems like someone got some code for Timer1
149- // and haphazardly changed the 1's in the register names to 0's, but the two timers don't work
150- // the same way, so this code doesn't do what it says at all. Is it even useful to have?
151- /* configure timer 0 for a rate of 16M5/(1024 * 256) = 62.94 Hz (~16ms) */
152- // TCCR0A = 5; /* timer 0 prescaler: 1024 */
153-
154-
155-
156- // TIMSK &= !(1<TOIE0);//interrupt off
157- cli ();
158- usbDeviceDisconnect ();
159- _delay_ms (250 );
160- usbDeviceConnect ();
161-
148+
162149 rt_usbHidReportDescriptor = mouse_usbHidReportDescriptor;
163150 rt_usbHidReportDescriptorSize = sizeof (mouse_usbHidReportDescriptor);
164151 rt_usbDeviceDescriptor = usbDescrDevice;
165152 rt_usbDeviceDescriptorSize = sizeof (usbDescrDevice);
166-
153+ }
154+
155+ void init () {
156+ cli ();
157+ usbDeviceDisconnect ();
158+ _delay_ms (200 );
159+ usbDeviceConnect ();
167160
168161 usbInit ();
169162
Original file line number Diff line number Diff line change 55#include " DigiMouse.h"
66
77void setup () {
8- // Do nothing? It seems as if the USB hardware is ready to go on reset
8+ DigiMouse. init (); // call init to enumerate
99}
1010
1111void loop () {
You can’t perform that action at this time.
0 commit comments