mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-10-02 14:58:59 +02:00
keyboard/annepro2: startup secondary LED MCU
This commit is contained in:
@@ -1,6 +1,23 @@
|
||||
#include "ch.h"
|
||||
#include "hal.h"
|
||||
#include "annepro2.h"
|
||||
|
||||
/**
|
||||
* @brief Driver default configuration.
|
||||
*/
|
||||
static const SerialConfig ledUartConfig = {
|
||||
.speed = 115200,
|
||||
};
|
||||
|
||||
static uint8_t ledMcuWakeup[11] = {
|
||||
0x7b, 0x10, 0x43, 0x10, 0x03, 0, 0, 0x7d, 0x02, 0x01, 0x02
|
||||
};
|
||||
|
||||
void OVERRIDE matrix_init_kb(void) {
|
||||
// Start uart
|
||||
sdStart(&SD0, &ledUartConfig);
|
||||
sdWrite(&SD0, ledMcuWakeup, 11);
|
||||
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,8 @@
|
||||
|
||||
// Alternate Functions
|
||||
#define AF_BITS(PORT, N) (\
|
||||
PAFIO(PORT, N, LINE_UART_RX, AFIO_USART)| \
|
||||
PAFIO(PORT, N, LINE_UART_TX, AFIO_USART)| \
|
||||
PAFIO(PORT, N, LINE_ROW1, AFIO_GPIO) | \
|
||||
PAFIO(PORT, N, LINE_ROW2, AFIO_GPIO) | \
|
||||
PAFIO(PORT, N, LINE_ROW3, AFIO_GPIO) | \
|
||||
@@ -178,23 +180,6 @@ void matrix_scan_kb() {
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// SPI Initialization
|
||||
|
||||
// static const SPIConfig spi1_config = {
|
||||
// .end_cb = NULL,
|
||||
// .cr0 = SPI_CR0_SELOEN,
|
||||
// .cr1 = 8 | SPI_CR1_FORMAT_MODE0 | SPI_CR1_MODE,
|
||||
// .cpr = 1,
|
||||
// .fcr = 0,
|
||||
// };
|
||||
|
||||
// void spi_init(void) {
|
||||
// spiStart(&SPID1, &spi1_config);
|
||||
// palSetLine(LINE_SPI_CS);
|
||||
// }
|
||||
|
||||
/**
|
||||
* @brief Board-specific initialization code.
|
||||
* @todo Add your board-specific code, if any.
|
||||
|
||||
@@ -34,6 +34,9 @@
|
||||
* I/O
|
||||
*/
|
||||
|
||||
#define LINE_UART_TX PAL_LINE(IOPORTB, 0)
|
||||
#define LINE_UART_RX PAL_LINE(IOPORTB, 1)
|
||||
|
||||
// outputs (rows are pulled low)
|
||||
#define LINE_ROW1 PAL_LINE(IOPORTC, 2)
|
||||
#define LINE_ROW2 PAL_LINE(IOPORTC, 1)
|
||||
@@ -51,6 +54,7 @@
|
||||
#define LINE_COL7 PAL_LINE(IOPORTA, 8)
|
||||
#define LINE_COL8 PAL_LINE(IOPORTA, 10)
|
||||
#define LINE_COL9 PAL_LINE(IOPORTA, 11)
|
||||
// PORTA 12,13 conflict with SWD
|
||||
#define LINE_COL10 PAL_LINE(IOPORTA, 12)
|
||||
#define LINE_COL11 PAL_LINE(IOPORTA, 13)
|
||||
#define LINE_COL12 PAL_LINE(IOPORTA, 14)
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
* @brief Enables the SERIAL subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SERIAL FALSE
|
||||
#define HAL_USE_SERIAL TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -50,14 +50,14 @@
|
||||
* Peripheral driver settings
|
||||
*/
|
||||
|
||||
#define HT32_GPT_USE_BFTM0 TRUE
|
||||
#define HT32_GPT_BFTM0_IRQ_PRIORITY 4
|
||||
// #define HT32_GPT_USE_BFTM0 TRUE
|
||||
// #define HT32_GPT_BFTM0_IRQ_PRIORITY 4
|
||||
|
||||
//#define HT32_SPI_USE_SPI1 TRUE
|
||||
//#define HT32_SPI1_IRQ_PRIORITY 6
|
||||
|
||||
//#define HT32_UART_USE_USART0 TRUE
|
||||
//#define HT32_USART0_IRQ_PRIORITY 6
|
||||
#define HT32_SERIAL_USE_USART0 TRUE
|
||||
#define HT32_USART0_IRQ_PRIORITY 6
|
||||
|
||||
/*
|
||||
* USB driver settings
|
||||
@@ -66,7 +66,5 @@
|
||||
#define HT32_USB_USE_USB0 TRUE
|
||||
#define HT32_USB_USB0_IRQ_PRIORITY 5
|
||||
|
||||
#define HT32_PWM_USE_GPTM1 TRUE
|
||||
// #define HT32_GPT_BFTM1_IRQ_PRIORITY
|
||||
|
||||
#endif /* _MCUCONF_H_ */
|
||||
|
||||
Reference in New Issue
Block a user