ports: Reformat more C and Python source code.

These files that are reformatted only now fall under the list of files to
apply uncrustify/black formatting to.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2022-04-19 11:41:41 +10:00
parent fb10d15d47
commit 5c32111fa0
47 changed files with 322 additions and 328 deletions

View File

@ -40,23 +40,18 @@ void LIMIFROG_board_early_init(void) {
#define CONN_POS10_PORT GPIOB #define CONN_POS10_PORT GPIOB
#endif #endif
static inline void GPIO_HIGH(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin) static inline void GPIO_HIGH(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin) {
{
GPIOx->BSRR = (uint32_t)GPIO_Pin; GPIOx->BSRR = (uint32_t)GPIO_Pin;
} }
static inline int IS_GPIO_RESET(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin) static inline int IS_GPIO_RESET(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin) {
{
GPIO_PinState bitstatus; GPIO_PinState bitstatus;
if((GPIOx->IDR & GPIO_Pin) != (uint32_t)GPIO_PIN_RESET) if ((GPIOx->IDR & GPIO_Pin) != (uint32_t)GPIO_PIN_RESET) {
{
bitstatus = GPIO_PIN_SET; bitstatus = GPIO_PIN_SET;
} } else {
else
{
bitstatus = GPIO_PIN_RESET; bitstatus = GPIO_PIN_RESET;
} }
return (bitstatus==GPIO_PIN_RESET); return bitstatus == GPIO_PIN_RESET;
} }
/************************************************************** /**************************************************************
@ -94,8 +89,7 @@ static inline int IS_GPIO_RESET(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
********************************************************************/ ********************************************************************/
static void LBF_DFU_If_Needed(void) static void LBF_DFU_If_Needed(void) {
{
GPIO_InitTypeDef GPIO_InitStruct; GPIO_InitTypeDef GPIO_InitStruct;
@ -131,9 +125,7 @@ static void LBF_DFU_If_Needed(void)
HAL_GPIO_Init(CONN_POS10_PORT, &GPIO_InitStruct); HAL_GPIO_Init(CONN_POS10_PORT, &GPIO_InitStruct);
// If selection pin pulled low... // If selection pin pulled low...
if ( IS_GPIO_RESET(CONN_POS10_PORT, CONN_POS10_PIN )) if (IS_GPIO_RESET(CONN_POS10_PORT, CONN_POS10_PIN)) {
{
// Remap bootloader ROM (ie System Flash) to address 0x0 // Remap bootloader ROM (ie System Flash) to address 0x0
SYSCFG->MEMRMP = 0x00000001; SYSCFG->MEMRMP = 0x00000001;

View File

@ -86,4 +86,3 @@
#define MICROPY_HW_USRSW_PULL (GPIO_NOPULL) #define MICROPY_HW_USRSW_PULL (GPIO_NOPULL)
#define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_RISING) #define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_RISING)
#define MICROPY_HW_USRSW_PRESSED (1) #define MICROPY_HW_USRSW_PRESSED (1)

View File

@ -1 +1 @@
print('frzmpy1') print("frzmpy1")

View File

@ -1,3 +1,3 @@
# test frozen package with __init__.py # test frozen package with __init__.py
print('frzmpy_pkg1.__init__') print("frzmpy_pkg1.__init__")
x = 1 x = 1

View File

@ -1,4 +1,6 @@
# test frozen package without __init__.py # test frozen package without __init__.py
print('frzmpy_pkg2.mod') print("frzmpy_pkg2.mod")
class Foo: class Foo:
x = 1 x = 1

View File

@ -1 +1 @@
print('frzstr1') print("frzstr1")

View File

@ -1,3 +1,3 @@
# test frozen package with __init__.py # test frozen package with __init__.py
print('frzstr_pkg1.__init__') print("frzstr_pkg1.__init__")
x = 1 x = 1

View File

@ -1,4 +1,6 @@
# test frozen package without __init__.py # test frozen package without __init__.py
print('frzstr_pkg2.mod') print("frzstr_pkg2.mod")
class Foo: class Foo:
x = 1 x = 1

View File

@ -1,2 +1,2 @@
freeze_as_mpy('$(MPY_DIR)/tools', 'upip.py') freeze_as_mpy("$(MPY_DIR)/tools", "upip.py")
freeze_as_mpy('$(MPY_DIR)/tools', 'upip_utarfile.py', opt=3) freeze_as_mpy("$(MPY_DIR)/tools", "upip_utarfile.py", opt=3)

View File

@ -30,8 +30,7 @@ static struct k_sem uart_sem;
static uint8_t uart_ringbuf[UART_BUFSIZE]; static uint8_t uart_ringbuf[UART_BUFSIZE];
static uint8_t i_get, i_put; static uint8_t i_get, i_put;
static int console_irq_input_hook(uint8_t ch) static int console_irq_input_hook(uint8_t ch) {
{
int i_next = (i_put + 1) & (UART_BUFSIZE - 1); int i_next = (i_put + 1) & (UART_BUFSIZE - 1);
if (i_next == i_get) { if (i_next == i_get) {
printk("UART buffer overflow - char dropped\n"); printk("UART buffer overflow - char dropped\n");