Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

also send longer commands on keypresses

  • Loading branch information...
commit 38ac313646c6263530cd5e7a987797635af0d34a 1 parent a29304b
@stapelberg stapelberg authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 aussen-neu/main.c
View
9 aussen-neu/main.c
@@ -234,8 +234,8 @@ int main() {
sei();
int c;
- char buffer[12];
- buffer[11] = '\0';
+ char keypress_buffer[COMMAND_BUFFER_SIZE + strlen("\r\n")] =
+ "^PAD c $\r\n";
char bufcopy[COMMAND_BUFFER_SIZE];
for (;;) {
/* Handle commands received on the UART */
@@ -254,9 +254,8 @@ int main() {
if (sample != lookup_table[c].state ||
lookup_table[c].debounce != DEBOUNCE_MS)
continue;
- strncpy(buffer, "^PAD c $\r\n", strlen("^PAD c $\r\n"));
- buffer[5] = lookup_table[c].key;
- uart2_puts(buffer);
+ keypress_buffer[5] = lookup_table[c].key;
+ uart2_puts(keypress_buffer);
lookup_table[c].debounce = DEBOUNCE_MS+1;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.