diff options
Diffstat (limited to 'platforms/chibios/drivers/serial_usart.h')
-rw-r--r-- | platforms/chibios/drivers/serial_usart.h | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/platforms/chibios/drivers/serial_usart.h b/platforms/chibios/drivers/serial_usart.h index 81fe9e0113..98c634dac0 100644 --- a/platforms/chibios/drivers/serial_usart.h +++ b/platforms/chibios/drivers/serial_usart.h @@ -1,18 +1,5 @@ -/* Copyright 2021 QMK - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ +// Copyright 2021 QMK +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once @@ -23,8 +10,24 @@ #include <ch.h> #include <hal.h> -#if !defined(SERIAL_USART_DRIVER) -# define SERIAL_USART_DRIVER SD1 +#if HAL_USE_SERIAL + +typedef SerialDriver QMKSerialDriver; +typedef SerialConfig QMKSerialConfig; + +# if !defined(SERIAL_USART_DRIVER) +# define SERIAL_USART_DRIVER SD1 +# endif + +#elif HAL_USE_SIO + +typedef SIODriver QMKSerialDriver; +typedef SIOConfig QMKSerialConfig; + +# if !defined(SERIAL_USART_DRIVER) +# define SERIAL_USART_DRIVER SIOD1 +# endif + #endif #if !defined(USE_GPIOV1) @@ -113,4 +116,4 @@ # define SERIAL_USART_TIMEOUT 20 #endif -#define HANDSHAKE_MAGIC 7 +#define HANDSHAKE_MAGIC 7U |