Skip to content

Commit 5b700b0

Browse files
committed
all: Reformat remaining C code that doesn't have a space after a comma.
Signed-off-by: Damien George <[email protected]>
1 parent aec8db3 commit 5b700b0

File tree

10 files changed

+28
-28
lines changed

10 files changed

+28
-28
lines changed

ports/esp8266/esppwm.c

+15-15
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ void ICACHE_FLASH_ATTR
121121
pwm_start(void) {
122122
uint8 i, j;
123123
PWM_DBG("--Function pwm_start() is called\n");
124-
PWM_DBG("pwm_gpio:%x,pwm_channel_num:%d\n",pwm_gpio,pwm_channel_num);
125-
PWM_DBG("pwm_out_io_num[0]:%d,[1]:%d,[2]:%d\n",pwm_out_io_num[0],pwm_out_io_num[1],pwm_out_io_num[2]);
126-
PWM_DBG("pwm.period:%d,pwm.duty[0]:%d,[1]:%d,[2]:%d\n",pwm.period,pwm.duty[0],pwm.duty[1],pwm.duty[2]);
124+
PWM_DBG("pwm_gpio:%x,pwm_channel_num:%d\n", pwm_gpio, pwm_channel_num);
125+
PWM_DBG("pwm_out_io_num[0]:%d,[1]:%d,[2]:%d\n", pwm_out_io_num[0], pwm_out_io_num[1], pwm_out_io_num[2]);
126+
PWM_DBG("pwm.period:%d,pwm.duty[0]:%d,[1]:%d,[2]:%d\n", pwm.period, pwm.duty[0], pwm.duty[1], pwm.duty[2]);
127127

128128
LOCK_PWM(critical); // enter critical
129129

@@ -137,20 +137,20 @@ pwm_start(void) {
137137
for (i = 0; i < pwm_channel_num; i++) {
138138
uint32 us = pwm.period * pwm.duty[i] / PWM_DEPTH;
139139
local_single[i].h_time = US_TO_RTC_TIMER_TICKS(us);
140-
PWM_DBG("i:%d us:%d ht:%d\n",i,us,local_single[i].h_time);
140+
PWM_DBG("i:%d us:%d ht:%d\n", i, us, local_single[i].h_time);
141141
local_single[i].gpio_set = 0;
142142
local_single[i].gpio_clear = 1 << pin_num[pwm_out_io_num[i]];
143143
}
144144

145145
local_single[pwm_channel_num].h_time = US_TO_RTC_TIMER_TICKS(pwm.period);
146146
local_single[pwm_channel_num].gpio_set = pwm_gpio;
147147
local_single[pwm_channel_num].gpio_clear = 0;
148-
PWM_DBG("i:%d period:%d ht:%d\n",pwm_channel_num,pwm.period,local_single[pwm_channel_num].h_time);
148+
PWM_DBG("i:%d period:%d ht:%d\n", pwm_channel_num, pwm.period, local_single[pwm_channel_num].h_time);
149149
// step 2: sort, small to big
150150
pwm_insert_sort(local_single, pwm_channel_num + 1);
151151

152152
*local_channel = pwm_channel_num + 1;
153-
PWM_DBG("1channel:%d,single[0]:%d,[1]:%d,[2]:%d,[3]:%d\n",*local_channel,local_single[0].h_time,local_single[1].h_time,local_single[2].h_time,local_single[3].h_time);
153+
PWM_DBG("1channel:%d,single[0]:%d,[1]:%d,[2]:%d,[3]:%d\n", *local_channel, local_single[0].h_time, local_single[1].h_time, local_single[2].h_time, local_single[3].h_time);
154154
// step 3: combine same duty channels
155155
for (i = pwm_channel_num; i > 0; i--) {
156156
if (local_single[i].h_time == local_single[i - 1].h_time) {
@@ -164,7 +164,7 @@ pwm_start(void) {
164164
(*local_channel)--;
165165
}
166166
}
167-
PWM_DBG("2channel:%d,single[0]:%d,[1]:%d,[2]:%d,[3]:%d\n",*local_channel,local_single[0].h_time,local_single[1].h_time,local_single[2].h_time,local_single[3].h_time);
167+
PWM_DBG("2channel:%d,single[0]:%d,[1]:%d,[2]:%d,[3]:%d\n", *local_channel, local_single[0].h_time, local_single[1].h_time, local_single[2].h_time, local_single[3].h_time);
168168
// step 4: cacl delt time
169169
for (i = *local_channel - 1; i > 0; i--) {
170170
local_single[i].h_time -= local_single[i - 1].h_time;
@@ -203,7 +203,7 @@ pwm_start(void) {
203203
}
204204

205205
UNLOCK_PWM(critical); // leave critical
206-
PWM_DBG("3channel:%d,single[0]:%d,[1]:%d,[2]:%d,[3]:%d\n",*local_channel,local_single[0].h_time,local_single[1].h_time,local_single[2].h_time,local_single[3].h_time);
206+
PWM_DBG("3channel:%d,single[0]:%d,[1]:%d,[2]:%d,[3]:%d\n", *local_channel, local_single[0].h_time, local_single[1].h_time, local_single[2].h_time, local_single[3].h_time);
207207
}
208208

209209
/******************************************************************************
@@ -365,9 +365,9 @@ pwm_init(void) {
365365
int ICACHE_FLASH_ATTR
366366
pwm_add(uint8_t pin_id, uint32_t pin_mux, uint32_t pin_func) {
367367
PWM_DBG("--Function pwm_add() is called. channel:%d\n", channel);
368-
PWM_DBG("pwm_gpio:%x,pwm_channel_num:%d\n",pwm_gpio,pwm_channel_num);
369-
PWM_DBG("pwm_out_io_num[0]:%d,[1]:%d,[2]:%d\n",pwm_out_io_num[0],pwm_out_io_num[1],pwm_out_io_num[2]);
370-
PWM_DBG("pwm.duty[0]:%d,[1]:%d,[2]:%d\n",pwm.duty[0],pwm.duty[1],pwm.duty[2]);
368+
PWM_DBG("pwm_gpio:%x,pwm_channel_num:%d\n", pwm_gpio, pwm_channel_num);
369+
PWM_DBG("pwm_out_io_num[0]:%d,[1]:%d,[2]:%d\n", pwm_out_io_num[0], pwm_out_io_num[1], pwm_out_io_num[2]);
370+
PWM_DBG("pwm.duty[0]:%d,[1]:%d,[2]:%d\n", pwm.duty[0], pwm.duty[1], pwm.duty[2]);
371371
int channel = -1;
372372
for (int i = 0; i < PWM_CHANNEL; ++i) {
373373
if (pin_num[i] == pin_id) {
@@ -401,10 +401,10 @@ pwm_add(uint8_t pin_id, uint32_t pin_mux, uint32_t pin_func) {
401401
bool ICACHE_FLASH_ATTR
402402
pwm_delete(uint8 channel) {
403403
PWM_DBG("--Function pwm_delete() is called. channel:%d\n", channel);
404-
PWM_DBG("pwm_gpio:%x,pwm_channel_num:%d\n",pwm_gpio,pwm_channel_num);
405-
PWM_DBG("pwm_out_io_num[0]:%d,[1]:%d,[2]:%d\n",pwm_out_io_num[0],pwm_out_io_num[1],pwm_out_io_num[2]);
406-
PWM_DBG("pwm.duty[0]:%d,[1]:%d,[2]:%d\n",pwm.duty[0],pwm.duty[1],pwm.duty[2]);
407-
uint8 i,j;
404+
PWM_DBG("pwm_gpio:%x,pwm_channel_num:%d\n", pwm_gpio, pwm_channel_num);
405+
PWM_DBG("pwm_out_io_num[0]:%d,[1]:%d,[2]:%d\n", pwm_out_io_num[0], pwm_out_io_num[1], pwm_out_io_num[2]);
406+
PWM_DBG("pwm.duty[0]:%d,[1]:%d,[2]:%d\n", pwm.duty[0], pwm.duty[1], pwm.duty[2]);
407+
uint8 i, j;
408408
for (i = 0; i < pwm_channel_num; i++) {
409409
if (pwm_out_io_num[i] == channel) { // exist
410410
LOCK_PWM(critical); // enter critical

ports/esp8266/hspi.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
// 80 / 20 = 4 MHz
5353

5454
void spi_init(uint8_t spi_no);
55-
void spi_mode(uint8_t spi_no, uint8_t spi_cpha,uint8_t spi_cpol);
55+
void spi_mode(uint8_t spi_no, uint8_t spi_cpha, uint8_t spi_cpol);
5656
void spi_init_gpio(uint8_t spi_no, uint8_t sysclk_as_spiclk);
5757
void spi_clock(uint8_t spi_no, uint16_t prediv, uint8_t cntdiv);
5858
void spi_tx_byte_order(uint8_t spi_no, uint8_t byte_order);

ports/samd/samd_flash.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ STATIC samd_flash_obj_t samd_flash_obj = {
6363
// FLASH stuff
6464
STATIC mp_obj_t samd_flash_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) {
6565
// No args required. bdev=Flash(). Start Addr & Size defined in samd_flash_obj.
66-
mp_arg_check_num(n_args, n_kw, 0,0, false);
66+
mp_arg_check_num(n_args, n_kw, 0, 0, false);
6767

6868
// Return singleton object.
6969
return MP_OBJ_FROM_PTR(&samd_flash_obj);
@@ -90,7 +90,7 @@ STATIC mp_obj_t eraseblock(uint32_t sector_in) {
9090
uint32_t DEST_ADDR = sector_in; // Number of pages to be erased.
9191
mp_int_t PAGE_SIZE = flash_get_page_size(&flash_desc); // adf4 API call
9292

93-
flash_erase(&flash_desc,DEST_ADDR,(BLOCK_SIZE / PAGE_SIZE));
93+
flash_erase(&flash_desc, DEST_ADDR, (BLOCK_SIZE / PAGE_SIZE));
9494

9595
return mp_const_none;
9696
}
@@ -121,7 +121,7 @@ STATIC mp_obj_t samd_flash_readblocks(size_t n_args, const mp_obj_t *args) {
121121
}
122122

123123
// Read data to flash (adf4 API)
124-
flash_read(&flash_desc,offset,bufinfo.buf,bufinfo.len);
124+
flash_read(&flash_desc, offset, bufinfo.buf, bufinfo.len);
125125

126126
return mp_const_none;
127127
}
@@ -138,7 +138,7 @@ STATIC mp_obj_t samd_flash_writeblocks(size_t n_args, const mp_obj_t *args) {
138138
offset += mp_obj_get_int(args[3]);
139139
}
140140
// Write data to flash (adf4 API)
141-
flash_write(&flash_desc,offset, bufinfo.buf, bufinfo.len);
141+
flash_write(&flash_desc, offset, bufinfo.buf, bufinfo.len);
142142
// TODO check return value
143143
return mp_const_none;
144144
}
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// const uint8_t mboot_pack_sign_secret_key[] = {0xf1,0xd8,0x66,0x08,0xbc,0x78,0x39,0x65,0x6a,0xf4,0x88,0xf4,0x43,0x4d,0x10,0xfe,0x4f,0x79,0xb9,0xc3,0x77,0x36,0x23,0xc8,0xcf,0x62,0xa1,0x90,0xf1,0xdc,0xd9,0xbc,0xb2,0x2e,0x59,0x1e,0x53,0x04,0x54,0xd5,0xd1,0x3a,0x6d,0x2e,0x79,0x3e,0xb5,0x70,0xb4,0x9f,0x33,0xff,0x90,0x1d,0xc3,0x54,0x90,0x12,0x96,0x79,0xf4,0xed,0x56,0x75};
2-
const uint8_t mboot_pack_sign_public_key[] = {0xb2,0x2e,0x59,0x1e,0x53,0x04,0x54,0xd5,0xd1,0x3a,0x6d,0x2e,0x79,0x3e,0xb5,0x70,0xb4,0x9f,0x33,0xff,0x90,0x1d,0xc3,0x54,0x90,0x12,0x96,0x79,0xf4,0xed,0x56,0x75};
3-
const uint8_t mboot_pack_secretbox_key[] = {0x4a,0xbe,0x9b,0xed,0x55,0x9f,0x74,0xeb,0x1e,0x70,0xde,0xf5,0x19,0x0a,0xeb,0xa5,0x68,0xea,0xb0,0x88,0xe6,0xfe,0x4d,0x10,0x69,0x23,0x06,0x7f,0xdd,0x83,0xf0,0xbf};
2+
const uint8_t mboot_pack_sign_public_key[] = {0xb2, 0x2e, 0x59, 0x1e, 0x53, 0x04, 0x54, 0xd5, 0xd1, 0x3a, 0x6d, 0x2e, 0x79, 0x3e, 0xb5, 0x70, 0xb4, 0x9f, 0x33, 0xff, 0x90, 0x1d, 0xc3, 0x54, 0x90, 0x12, 0x96, 0x79, 0xf4, 0xed, 0x56, 0x75};
3+
const uint8_t mboot_pack_secretbox_key[] = {0x4a, 0xbe, 0x9b, 0xed, 0x55, 0x9f, 0x74, 0xeb, 0x1e, 0x70, 0xde, 0xf5, 0x19, 0x0a, 0xeb, 0xa5, 0x68, 0xea, 0xb0, 0x88, 0xe6, 0xfe, 0x4d, 0x10, 0x69, 0x23, 0x06, 0x7f, 0xdd, 0x83, 0xf0, 0xbf};
44

55
// The above keys are for demonstration purposes only, do not use them in production!

ports/stm32/pyb_i2c.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ void i2c_er_irq_handler(mp_uint_t i2c_id) {
541541
// I2C Acknowledge failure
542542
if (sr1 & I2C_FLAG_AF) {
543543
hi2c->ErrorCode |= HAL_I2C_ERROR_AF;
544-
SET_BIT(hi2c->Instance->CR1,I2C_CR1_STOP);
544+
SET_BIT(hi2c->Instance->CR1, I2C_CR1_STOP);
545545
__HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF);
546546
}
547547

ports/stm32/ulpi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#define USBULPI_TIMEOUT_COUNT (100)
3232

3333
#define USB_OTG_READ_REG32(reg) (*(__IO uint32_t *)(reg))
34-
#define USB_OTG_WRITE_REG32(reg,value) (*(__IO uint32_t *)(reg) = (value))
34+
#define USB_OTG_WRITE_REG32(reg, value) (*(__IO uint32_t *)(reg) = (value))
3535

3636
/**
3737
* @brief Read CR value

ports/stm32/usbd_msc_interface.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ STATIC const int8_t usbd_msc_inquiry_data[36] = {
102102
'M', 'i', 'c', 'r', 'o', 'P', 'y', ' ', // Manufacturer : 8 bytes
103103
'p', 'y', 'b', 'o', 'a', 'r', 'd', ' ', // Product : 16 Bytes
104104
'F', 'l', 'a', 's', 'h', ' ', ' ', ' ',
105-
'1', '.', '0','0', // Version : 4 Bytes
105+
'1', '.', '0', '0', // Version : 4 Bytes
106106
};
107107

108108
// Set the logical units that will be exposed over MSC

ports/unix/modtime.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static inline int msec_sleep_tv(struct timeval *tv) {
4545
msec_sleep(tv->tv_sec * 1000.0 + tv->tv_usec / 1000.0);
4646
return 0;
4747
}
48-
#define sleep_select(a,b,c,d,e) msec_sleep_tv((e))
48+
#define sleep_select(a, b, c, d, e) msec_sleep_tv((e))
4949
#else
5050
#define sleep_select select
5151
#endif

ports/unix/modusocket.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_setblocking_obj, socket_setblocking);
402402

403403
STATIC mp_obj_t socket_settimeout(mp_obj_t self_in, mp_obj_t timeout_in) {
404404
mp_obj_socket_t *self = MP_OBJ_TO_PTR(self_in);
405-
struct timeval tv = {0,};
405+
struct timeval tv = {0, };
406406
bool new_blocking = true;
407407

408408
// Timeout of None means no timeout, which in POSIX is signified with 0 timeout,

py/nlr.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ NORETURN void nlr_jump_fail(void *val);
167167

168168
#if !MICROPY_NLR_SETJMP
169169
#define nlr_push(val) \
170-
assert(MP_STATE_THREAD(nlr_top) != val),nlr_push(val)
170+
assert(MP_STATE_THREAD(nlr_top) != val), nlr_push(val)
171171

172172
/*
173173
#define nlr_push(val) \

0 commit comments

Comments
 (0)