Format code according to conventions (#11905)
Co-authored-by: QMK Bot <hello@qmk.fm>
This commit is contained in:
parent
4ddb5abea5
commit
c27a778281
@ -18,12 +18,7 @@
|
|||||||
|
|
||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
|
|
||||||
static SerialConfig serialConfig = {
|
static SerialConfig serialConfig = {SERIAL_DEFAULT_BITRATE, SD1_CR1, SD1_CR2, SD1_CR3};
|
||||||
SERIAL_DEFAULT_BITRATE,
|
|
||||||
SD1_CR1,
|
|
||||||
SD1_CR2,
|
|
||||||
SD1_CR3
|
|
||||||
};
|
|
||||||
|
|
||||||
void uart_init(uint32_t baud) {
|
void uart_init(uint32_t baud) {
|
||||||
static bool is_initialised = false;
|
static bool is_initialised = false;
|
||||||
@ -44,9 +39,7 @@ void uart_init(uint32_t baud) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void uart_putchar(uint8_t c) {
|
void uart_putchar(uint8_t c) { sdPut(&SERIAL_DRIVER, c); }
|
||||||
sdPut(&SERIAL_DRIVER, c);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t uart_getchar(void) {
|
uint8_t uart_getchar(void) {
|
||||||
msg_t res = sdGet(&SERIAL_DRIVER);
|
msg_t res = sdGet(&SERIAL_DRIVER);
|
||||||
@ -54,6 +47,4 @@ uint8_t uart_getchar(void) {
|
|||||||
return (uint8_t)res;
|
return (uint8_t)res;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool uart_available(void) {
|
bool uart_available(void) { return !sdGetWouldBlock(&SERIAL_DRIVER); }
|
||||||
return !sdGetWouldBlock(&SERIAL_DRIVER);
|
|
||||||
}
|
|
||||||
|
@ -84,23 +84,23 @@ static void gpt_cb8(GPTDriver *gptp);
|
|||||||
# define DAC_SAMPLE_MAX 65535U
|
# define DAC_SAMPLE_MAX 65535U
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define START_CHANNEL_1() \
|
#define START_CHANNEL_1() \
|
||||||
gptStart(&GPTD6, &gpt6cfg1); \
|
gptStart(&GPTD6, &gpt6cfg1); \
|
||||||
gptStartContinuous(&GPTD6, 2U); \
|
gptStartContinuous(&GPTD6, 2U); \
|
||||||
palSetPadMode(GPIOA, 4, PAL_MODE_INPUT_ANALOG)
|
palSetPadMode(GPIOA, 4, PAL_MODE_INPUT_ANALOG)
|
||||||
#define START_CHANNEL_2() \
|
#define START_CHANNEL_2() \
|
||||||
gptStart(&GPTD7, &gpt7cfg1); \
|
gptStart(&GPTD7, &gpt7cfg1); \
|
||||||
gptStartContinuous(&GPTD7, 2U); \
|
gptStartContinuous(&GPTD7, 2U); \
|
||||||
palSetPadMode(GPIOA, 5, PAL_MODE_INPUT_ANALOG)
|
palSetPadMode(GPIOA, 5, PAL_MODE_INPUT_ANALOG)
|
||||||
#define STOP_CHANNEL_1() \
|
#define STOP_CHANNEL_1() \
|
||||||
gptStopTimer(&GPTD6); \
|
gptStopTimer(&GPTD6); \
|
||||||
palSetPadMode(GPIOA, 4, PAL_MODE_OUTPUT_PUSHPULL); \
|
palSetPadMode(GPIOA, 4, PAL_MODE_OUTPUT_PUSHPULL); \
|
||||||
palSetPad(GPIOA, 4)
|
palSetPad(GPIOA, 4)
|
||||||
#define STOP_CHANNEL_2() \
|
#define STOP_CHANNEL_2() \
|
||||||
gptStopTimer(&GPTD7); \
|
gptStopTimer(&GPTD7); \
|
||||||
palSetPadMode(GPIOA, 5, PAL_MODE_OUTPUT_PUSHPULL); \
|
palSetPadMode(GPIOA, 5, PAL_MODE_OUTPUT_PUSHPULL); \
|
||||||
palSetPad(GPIOA, 5)
|
palSetPad(GPIOA, 5)
|
||||||
#define RESTART_CHANNEL_1() \
|
#define RESTART_CHANNEL_1() \
|
||||||
STOP_CHANNEL_1(); \
|
STOP_CHANNEL_1(); \
|
||||||
START_CHANNEL_1()
|
START_CHANNEL_1()
|
||||||
#define RESTART_CHANNEL_2() \
|
#define RESTART_CHANNEL_2() \
|
||||||
|
@ -237,13 +237,13 @@ __attribute__((weak)) void bootloader_jump(void) {
|
|||||||
"bootloader_startup_loop%=: \n\t"
|
"bootloader_startup_loop%=: \n\t"
|
||||||
"rjmp bootloader_startup_loop%= \n\t"
|
"rjmp bootloader_startup_loop%= \n\t"
|
||||||
:
|
:
|
||||||
: [ mcucsrio ] "I"(_SFR_IO_ADDR(MCUCSR)),
|
: [mcucsrio] "I"(_SFR_IO_ADDR(MCUCSR)),
|
||||||
# if (FLASHEND > 131071)
|
# if (FLASHEND > 131071)
|
||||||
[ ramendhi ] "M"(((RAMEND - 2) >> 8) & 0xff), [ ramendlo ] "M"(((RAMEND - 2) >> 0) & 0xff), [ bootaddrhi ] "M"((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 16) & 0xff),
|
[ramendhi] "M"(((RAMEND - 2) >> 8) & 0xff), [ramendlo] "M"(((RAMEND - 2) >> 0) & 0xff), [bootaddrhi] "M"((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 16) & 0xff),
|
||||||
# else
|
# else
|
||||||
[ ramendhi ] "M"(((RAMEND - 1) >> 8) & 0xff), [ ramendlo ] "M"(((RAMEND - 1) >> 0) & 0xff),
|
[ramendhi] "M"(((RAMEND - 1) >> 8) & 0xff), [ramendlo] "M"(((RAMEND - 1) >> 0) & 0xff),
|
||||||
# endif
|
# endif
|
||||||
[ bootaddrme ] "M"((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 8) & 0xff), [ bootaddrlo ] "M"((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 0) & 0xff));
|
[bootaddrme] "M"((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 8) & 0xff), [bootaddrlo] "M"((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 0) & 0xff));
|
||||||
|
|
||||||
#else // Assume remaining boards are DFU, even if the flag isn't set
|
#else // Assume remaining boards are DFU, even if the flag isn't set
|
||||||
|
|
||||||
|
@ -305,7 +305,6 @@ int main(void) {
|
|||||||
// dprintf("5v=%u 5vu=%u dlow=%u dhi=%u gca=%u gcd=%u\r\n", v_5v, v_5v_avg, v_5v_avg - V5_LOW, v_5v_avg - V5_HIGH, gcr_actual, gcr_desired);
|
// dprintf("5v=%u 5vu=%u dlow=%u dhi=%u gca=%u gcd=%u\r\n", v_5v, v_5v_avg, v_5v_avg - V5_LOW, v_5v_avg - V5_HIGH, gcr_actual, gcr_desired);
|
||||||
}
|
}
|
||||||
#endif // CONSOLE_ENABLE
|
#endif // CONSOLE_ENABLE
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -874,7 +874,7 @@ void send_mouse(report_mouse_t *report) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#else /* MOUSE_ENABLE */
|
#else /* MOUSE_ENABLE */
|
||||||
void send_mouse(report_mouse_t *report) { (void)report; }
|
void send_mouse(report_mouse_t *report) { (void)report; }
|
||||||
#endif /* MOUSE_ENABLE */
|
#endif /* MOUSE_ENABLE */
|
||||||
|
|
||||||
/* ---------------------------------------------------------
|
/* ---------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user