format al68.c

This commit is contained in:
JackyJia73 2024-09-10 11:31:54 +08:00
parent 0e7de51ad5
commit 6ccff10f8c

View File

@ -6,31 +6,24 @@
#include "common/smart_ble.h" #include "common/smart_ble.h"
#include "al68.h" #include "al68.h"
void keyboard_pre_init_kb(void) { void keyboard_pre_init_kb(void) {
AFIO->MAPR = (AFIO->MAPR & ~AFIO_MAPR_SWJ_CFG_Msk); AFIO->MAPR = (AFIO->MAPR & ~AFIO_MAPR_SWJ_CFG_Msk);
AFIO->MAPR|= AFIO_MAPR_SWJ_CFG_DISABLE; //diable JTAG (GD32 different to STM32) AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_DISABLE; // diable JTAG (GD32 different to STM32)
gpio_set_pin_output(A8); gpio_set_pin_output(A8);
gpio_write_pin_high(A8); //ENABLE USB gpio_write_pin_high(A8); // ENABLE USB
uart_init(460800); uart_init(460800);
wait_ms(400); wait_ms(400);
} }
bool process_record_kb(uint16_t keycode, keyrecord_t* record) bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
{ if (record->event.pressed) {
if (record->event.pressed){ if ((keycode >= KC_BLE1) && (keycode <= KC_24G)) {
if ((keycode>=KC_BLE1) && (keycode<=KC_24G)) wireless_start(keycode - KC_USB);
{
wireless_start(keycode-KC_USB);
return false; return false;
} } else if (keycode == KC_USB) {
else if (keycode == KC_USB)
{
wireless_stop(); wireless_stop();
return false; return false;
} }
} }
return process_record_user(keycode, record); return process_record_user(keycode, record);
} }