kbd: now not a kbd anymore
This commit is contained in:
@@ -14,13 +14,9 @@ void setup() {
|
|||||||
|
|
||||||
pc = ParaComms{
|
pc = ParaComms{
|
||||||
.mosi_cb =
|
.mosi_cb =
|
||||||
[](uint8_t *data, uint8_t len) {
|
[](uint8_t* data, uint8_t len) {
|
||||||
for (int i = 0; i < len; i++) {
|
for (int i = 0; i < len; i++) {
|
||||||
Serial.printf("%c", data[i]);
|
Serial.printf("%c", data[i]);
|
||||||
pc.SendByte(data[i]); // echo
|
|
||||||
if (data[i] == '\r') {
|
|
||||||
pc.SendByte('\n');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -32,7 +28,7 @@ void loop() {
|
|||||||
static int led_counter = 0;
|
static int led_counter = 0;
|
||||||
static int led = HIGH;
|
static int led = HIGH;
|
||||||
|
|
||||||
static int mode = 0; // 0 = keyboard, 1 = parallel
|
static int mode = 0; // 0 = keyboard, 1 = parallel
|
||||||
|
|
||||||
if (led_counter > 400000) {
|
if (led_counter > 400000) {
|
||||||
led_counter = 0;
|
led_counter = 0;
|
||||||
@@ -41,7 +37,7 @@ void loop() {
|
|||||||
}
|
}
|
||||||
led_counter += 1;
|
led_counter += 1;
|
||||||
|
|
||||||
checkKbdReset();
|
// checkKbdReset();
|
||||||
|
|
||||||
uint8_t mosib;
|
uint8_t mosib;
|
||||||
if (strobeOccurred(mosib)) {
|
if (strobeOccurred(mosib)) {
|
||||||
@@ -52,6 +48,9 @@ void loop() {
|
|||||||
|
|
||||||
if (Serial.available() > 0) {
|
if (Serial.available() > 0) {
|
||||||
int c = Serial.read();
|
int c = Serial.read();
|
||||||
|
#if 1
|
||||||
|
pc.SendByte(c);
|
||||||
|
#else
|
||||||
if (c == 2) {
|
if (c == 2) {
|
||||||
mode = 0;
|
mode = 0;
|
||||||
} else if (c == 3) {
|
} else if (c == 3) {
|
||||||
@@ -63,5 +62,6 @@ void loop() {
|
|||||||
pc.SendByte(c);
|
pc.SendByte(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user