summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <yuval@y3xz.com>2016-03-26 13:33:31 +0300
committerYuval Adam <yuval@y3xz.com>2016-03-26 13:33:31 +0300
commit80f40c3daf0e076da6fdcae55835f8cbd313bf3a (patch)
treeb5792c504f94cd741cbe37977e4359f59f9d590c
parentb0431472a7303a03547e8674bc8c761ff744a2f0 (diff)
Single char send on boot isn't working yet
-rw-r--r--keyboard/keyboard.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/keyboard/keyboard.c b/keyboard/keyboard.c
index d3503d4..ae57bb6 100644
--- a/keyboard/keyboard.c
+++ b/keyboard/keyboard.c
@@ -122,7 +122,7 @@ void buildReport(uchar send_key) {
#define STATE_RELEASE_KEY 2
int main() {
- uchar i, button_release_counter = 0, state = STATE_WAIT;
+ uchar i, button_release_counter = 0, state = STATE_SEND_KEY;
DDRB |= _BV(DDB1);
@@ -150,22 +150,6 @@ int main() {
wdt_reset(); // keep the watchdog happy
usbPoll();
- continue; // stop here for now
- /////////////////////////////
-
- if (!(PINB & (1<<PB1))) { // button pressed (PB1 at ground voltage)
- // also check if some time has elapsed since last button press
- if (state == STATE_WAIT && button_release_counter == 255)
- state = STATE_SEND_KEY;
-
- button_release_counter = 0; // now button needs to be released a while until retrigger
- }
-
- if(button_release_counter < 255)
- button_release_counter++; // increase release counter
-
- // characters are sent when messageState == STATE_SEND and after receiving
- // the initial LED state from PC (good way to wait until device is recognized)
if (usbInterruptIsReady() && state != STATE_WAIT && LED_state != 0xff) {
switch(state) {
case STATE_SEND_KEY: