1
0
Fork 0

Migrate serial_uart usages to UART driver (#15479)

* Migrate Thermal Printer feature to UART driver

* Migrate 40percentclub UT47 to UART driver

* Migrate Centromere to UART driver

* Migrate Chimera Ergo to UART driver

* Migrate Chimera Let's Split to UART driver

* Migrate Chimera Ortho to UART driver

* Migrate Chimera Ortho Plus to UART driver

* Migrate Comet46 to UART driver

* Migrate Palm USB converter to UART driver

* Migrate Sun USB converter to UART driver

* Migrate Dichotomy to UART driver

* Migrate Honeycomb to UART driver

* Migrate Mitosis to UART driver

* Migrate Redox W to UART driver

* Migrate Uni660 to UART driver

* Migrate Telophase to UART driver
This commit is contained in:
Ryan 2021-12-15 22:00:39 +11:00 committed by GitHub
parent c0bb153151
commit c12268807d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
63 changed files with 154 additions and 393 deletions

View file

@ -16,7 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
#include "protocol/serial.h"
#include "uart.h"
/*
* Matrix Array usage:
@ -74,7 +74,7 @@ void matrix_init(void)
/* PORTD |= (1<<6); */
debug_enable = true;
serial_init();
uart_init(1200);
// initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
@ -84,12 +84,12 @@ void matrix_init(void)
/* print("Reseting "); */
/* while (1) { */
/* print("."); */
/* while (serial_recv()); */
/* serial_send(0x01); */
/* while (uart_read()); */
/* uart_write(0x01); */
/* _delay_ms(500); */
/* if (serial_recv() == 0xFF) { */
/* if (uart_read() == 0xFF) { */
/* _delay_ms(500); */
/* if (serial_recv() == 0x04) */
/* if (uart_read() == 0x04) */
/* break; */
/* } */
/* } */
@ -104,7 +104,7 @@ void matrix_init(void)
uint8_t matrix_scan(void)
{
uint8_t code;
code = serial_recv();
code = uart_read();
if (!code) return 0;
debug_hex(code); debug(" ");
@ -113,7 +113,7 @@ uint8_t matrix_scan(void)
case 0xFF: // reset success: FF 04
print("reset: ");
_delay_ms(500);
code = serial_recv();
code = uart_read();
xprintf("%02X\n", code);
if (code == 0x04) {
// LED status
@ -123,12 +123,12 @@ uint8_t matrix_scan(void)
case 0xFE: // layout: FE <layout>
print("layout: ");
_delay_ms(500);
xprintf("%02X\n", serial_recv());
xprintf("%02X\n", uart_read());
return 0;
case 0x7E: // reset fail: 7E 01
print("reset fail: ");
_delay_ms(500);
xprintf("%02X\n", serial_recv());
xprintf("%02X\n", uart_read());
return 0;
case 0x7F:
// all keys up