Skip to content

Commit 483427a

Browse files
committed
hal: astyle update
1 parent d10e821 commit 483427a

20 files changed

+147
-126
lines changed

hal/TARGET_FLASH_CMSIS_ALGO/flash_common_algo.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static int32_t flash_algo_uninit(flash_t *obj, uint32_t address, uint32_t functi
9797
* @param end_addr End address to check. Could be the same as start_addr to just check start_addr
9898
* for e.g. flash_erase_sector.
9999
* @return 0 for success, -1 for error
100-
*/
100+
*/
101101
static int32_t flash_check_nonsecure(flash_t *obj, uint32_t start_addr, uint32_t end_addr)
102102
{
103103
/* Check if end address wraps around */
@@ -107,14 +107,14 @@ static int32_t flash_check_nonsecure(flash_t *obj, uint32_t start_addr, uint32_t
107107

108108
/* Check if start address is in non-secure flash */
109109
if ((start_addr < obj->target_config_ns->flash_start) ||
110-
(start_addr >= (obj->target_config_ns->flash_start + obj->target_config_ns->flash_size))) {
110+
(start_addr >= (obj->target_config_ns->flash_start + obj->target_config_ns->flash_size))) {
111111
return -1;
112112
}
113113

114114
/* Check if end address is in non-secure flash */
115115
if (end_addr != start_addr) {
116116
if ((end_addr < obj->target_config_ns->flash_start) ||
117-
(end_addr >= (obj->target_config_ns->flash_start + obj->target_config_ns->flash_size))) {
117+
(end_addr >= (obj->target_config_ns->flash_start + obj->target_config_ns->flash_size))) {
118118
return -1;
119119
}
120120
}

hal/TARGET_FLASH_CMSIS_ALGO/flash_data.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ typedef struct {
7474
uint32_t pc;
7575
} args_t;
7676

77-
typedef int32_t (*flash_algo_jump_t)(args_t*);
77+
typedef int32_t (*flash_algo_jump_t)(args_t *);
7878

7979
// prototypes for flash algo CMSIS API
8080

hal/can_api.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,23 @@ typedef void (*can_irq_handler)(uint32_t id, CanIrqType type);
5757

5858
typedef struct can_s can_t;
5959

60-
void can_init (can_t *obj, PinName rd, PinName td);
61-
void can_init_freq (can_t *obj, PinName rd, PinName td, int hz);
62-
void can_free (can_t *obj);
63-
int can_frequency (can_t *obj, int hz);
64-
65-
void can_irq_init (can_t *obj, can_irq_handler handler, uint32_t id);
66-
void can_irq_free (can_t *obj);
67-
void can_irq_set (can_t *obj, CanIrqType irq, uint32_t enable);
68-
69-
int can_write (can_t *obj, CAN_Message, int cc);
70-
int can_read (can_t *obj, CAN_Message *msg, int handle);
71-
int can_mode (can_t *obj, CanMode mode);
60+
void can_init(can_t *obj, PinName rd, PinName td);
61+
void can_init_freq(can_t *obj, PinName rd, PinName td, int hz);
62+
void can_free(can_t *obj);
63+
int can_frequency(can_t *obj, int hz);
64+
65+
void can_irq_init(can_t *obj, can_irq_handler handler, uint32_t id);
66+
void can_irq_free(can_t *obj);
67+
void can_irq_set(can_t *obj, CanIrqType irq, uint32_t enable);
68+
69+
int can_write(can_t *obj, CAN_Message, int cc);
70+
int can_read(can_t *obj, CAN_Message *msg, int handle);
71+
int can_mode(can_t *obj, CanMode mode);
7272
int can_filter(can_t *obj, uint32_t id, uint32_t mask, CANFormat format, int32_t handle);
73-
void can_reset (can_t *obj);
74-
unsigned char can_rderror (can_t *obj);
75-
unsigned char can_tderror (can_t *obj);
76-
void can_monitor (can_t *obj, int silent);
73+
void can_reset(can_t *obj);
74+
unsigned char can_rderror(can_t *obj);
75+
unsigned char can_tderror(can_t *obj);
76+
void can_monitor(can_t *obj, int silent);
7777

7878
#ifdef __cplusplus
7979
};

hal/crc_api.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ extern "C" {
145145
*
146146
* \return True if running if the polynomial is supported, false if not.
147147
*/
148-
bool hal_crc_is_supported(const crc_mbed_config_t* config);
148+
bool hal_crc_is_supported(const crc_mbed_config_t *config);
149149

150150
/** Initialize the hardware CRC module with the given polynomial
151151
*
@@ -177,7 +177,7 @@ bool hal_crc_is_supported(const crc_mbed_config_t* config);
177177
* hardware CRC module. For example, polynomial and initial seed
178178
* values.
179179
*/
180-
void hal_crc_compute_partial_start(const crc_mbed_config_t* config);
180+
void hal_crc_compute_partial_start(const crc_mbed_config_t *config);
181181

182182
/** Writes data to the current CRC module.
183183
*

hal/gpio_api.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,31 +86,31 @@ int gpio_read(gpio_t *obj);
8686
* @param gpio The GPIO object
8787
* @param pin The pin name
8888
*/
89-
void gpio_init_in(gpio_t* gpio, PinName pin);
89+
void gpio_init_in(gpio_t *gpio, PinName pin);
9090

9191
/** Init the input pin and set the mode
9292
*
9393
* @param gpio The GPIO object
9494
* @param pin The pin name
9595
* @param mode The pin mode to be set
9696
*/
97-
void gpio_init_in_ex(gpio_t* gpio, PinName pin, PinMode mode);
97+
void gpio_init_in_ex(gpio_t *gpio, PinName pin, PinMode mode);
9898

9999
/** Init the output pin as an output, with predefined output value 0
100100
*
101101
* @param gpio The GPIO object
102102
* @param pin The pin name
103103
* @return An integer value 1 or 0
104104
*/
105-
void gpio_init_out(gpio_t* gpio, PinName pin);
105+
void gpio_init_out(gpio_t *gpio, PinName pin);
106106

107107
/** Init the pin as an output and set the output value
108108
*
109109
* @param gpio The GPIO object
110110
* @param pin The pin name
111111
* @param value The value to be set
112112
*/
113-
void gpio_init_out_ex(gpio_t* gpio, PinName pin, int value);
113+
void gpio_init_out_ex(gpio_t *gpio, PinName pin, int value);
114114

115115
/** Init the pin to be in/out
116116
*
@@ -120,7 +120,7 @@ void gpio_init_out_ex(gpio_t* gpio, PinName pin, int value);
120120
* @param mode The pin mode to be set
121121
* @param value The value to be set for an output pin
122122
*/
123-
void gpio_init_inout(gpio_t* gpio, PinName pin, PinDirection direction, PinMode mode, int value);
123+
void gpio_init_inout(gpio_t *gpio, PinName pin, PinDirection direction, PinMode mode, int value);
124124

125125
/**@}*/
126126

hal/i2c_api.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ typedef struct i2c_s i2c_t;
5858
#endif
5959

6060
enum {
61-
I2C_ERROR_NO_SLAVE = -1,
62-
I2C_ERROR_BUS_BUSY = -2
61+
I2C_ERROR_NO_SLAVE = -1,
62+
I2C_ERROR_BUS_BUSY = -2
6363
};
6464

6565
#ifdef __cplusplus
@@ -73,7 +73,7 @@ extern "C" {
7373

7474
/** Initialize the I2C peripheral. It sets the default parameters for I2C
7575
* peripheral, and configures its specifieds pins.
76-
*
76+
*
7777
* @param obj The I2C object
7878
* @param sda The sda pin
7979
* @param scl The scl pin
@@ -117,7 +117,7 @@ int i2c_read(i2c_t *obj, int address, char *data, int length, int stop);
117117
* @param data The buffer for sending
118118
* @param length Number of bytes to write
119119
* @param stop Stop to be generated after the transfer is done
120-
* @return
120+
* @return
121121
* zero or non-zero - Number of written bytes
122122
* negative - I2C_ERROR_XXX status
123123
*/

hal/itm_api.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,23 @@ enum {
3838

3939
/**
4040
* @brief Target specific initialization function.
41-
* This function is responsible for initializing and configuring
42-
* the debug clock for the ITM and setting up the SWO pin for
41+
* This function is responsible for initializing and configuring
42+
* the debug clock for the ITM and setting up the SWO pin for
4343
* debug output.
44-
*
44+
*
4545
* The only Cortex-M register that should be modified is the clock
4646
* prescaler in TPI->ACPR.
47-
*
48-
* The generic mbed_itm_init initialization function will setup:
49-
*
47+
*
48+
* The generic mbed_itm_init initialization function will setup:
49+
*
5050
* ITM->LAR
5151
* ITM->TPR
5252
* ITM->TCR
5353
* ITM->TER
5454
* TPI->SPPR
5555
* TPI->FFCR
5656
* DWT->CTRL
57-
*
57+
*
5858
* for SWO output on stimulus port 0.
5959
*/
6060
void itm_init(void);

hal/lp_ticker_api.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ ticker_irq_handler_type set_lp_ticker_irq_handler(ticker_irq_handler_type ticker
7979
*
8080
* @return The low power ticker data
8181
*/
82-
const ticker_data_t* get_lp_ticker_data(void);
82+
const ticker_data_t *get_lp_ticker_data(void);
8383

8484
/** The wrapper for ticker_irq_handler, to pass lp ticker's data
8585
*
@@ -207,7 +207,7 @@ void lp_ticker_disable_interrupt(void);
207207
void lp_ticker_clear_interrupt(void);
208208

209209
/** Set pending interrupt that should be fired right away.
210-
*
210+
*
211211
* Pseudo Code:
212212
* @code
213213
* void lp_ticker_fire_interrupt(void)
@@ -232,7 +232,7 @@ void lp_ticker_fire_interrupt(void);
232232
* }
233233
* @endcode
234234
*/
235-
const ticker_info_t* lp_ticker_get_info(void);
235+
const ticker_info_t *lp_ticker_get_info(void);
236236

237237
/**@}*/
238238

hal/mbed_gpio.c

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
#include "hal/gpio_api.h"
1717

18-
static inline void _gpio_init_in(gpio_t* gpio, PinName pin, PinMode mode)
18+
static inline void _gpio_init_in(gpio_t *gpio, PinName pin, PinMode mode)
1919
{
2020
gpio_init(gpio, pin);
2121
if (pin != NC) {
@@ -24,7 +24,7 @@ static inline void _gpio_init_in(gpio_t* gpio, PinName pin, PinMode mode)
2424
}
2525
}
2626

27-
static inline void _gpio_init_out(gpio_t* gpio, PinName pin, PinMode mode, int value)
27+
static inline void _gpio_init_out(gpio_t *gpio, PinName pin, PinMode mode, int value)
2828
{
2929
gpio_init(gpio, pin);
3030
if (pin != NC) {
@@ -34,27 +34,33 @@ static inline void _gpio_init_out(gpio_t* gpio, PinName pin, PinMode mode, int v
3434
}
3535
}
3636

37-
void gpio_init_in(gpio_t* gpio, PinName pin) {
37+
void gpio_init_in(gpio_t *gpio, PinName pin)
38+
{
3839
gpio_init_in_ex(gpio, pin, PullDefault);
3940
}
4041

41-
void gpio_init_in_ex(gpio_t* gpio, PinName pin, PinMode mode) {
42+
void gpio_init_in_ex(gpio_t *gpio, PinName pin, PinMode mode)
43+
{
4244
_gpio_init_in(gpio, pin, mode);
4345
}
4446

45-
void gpio_init_out(gpio_t* gpio, PinName pin) {
47+
void gpio_init_out(gpio_t *gpio, PinName pin)
48+
{
4649
gpio_init_out_ex(gpio, pin, 0);
4750
}
4851

49-
void gpio_init_out_ex(gpio_t* gpio, PinName pin, int value) {
52+
void gpio_init_out_ex(gpio_t *gpio, PinName pin, int value)
53+
{
5054
_gpio_init_out(gpio, pin, PullNone, value);
5155
}
5256

53-
void gpio_init_inout(gpio_t* gpio, PinName pin, PinDirection direction, PinMode mode, int value) {
57+
void gpio_init_inout(gpio_t *gpio, PinName pin, PinDirection direction, PinMode mode, int value)
58+
{
5459
if (direction == PIN_INPUT) {
5560
_gpio_init_in(gpio, pin, mode);
56-
if (pin != NC)
57-
gpio_write(gpio, value); // we prepare the value in case it is switched later
61+
if (pin != NC) {
62+
gpio_write(gpio, value); // we prepare the value in case it is switched later
63+
}
5864
} else {
5965
_gpio_init_out(gpio, pin, mode, value);
6066
}

hal/mbed_itm_api.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#include <stdbool.h>
2323

24-
#define ITM_ENABLE_WRITE 0xC5ACCE55
24+
#define ITM_ENABLE_WRITE 0xC5ACCE55
2525

2626
#define SWO_NRZ 0x02
2727
#define SWO_STIMULUS_PORT 0x01
@@ -56,22 +56,21 @@ void mbed_itm_init(void)
5656
ITM->TPR = 0x0;
5757

5858
/* Trace Control Register */
59-
ITM->TCR = (1 << ITM_TCR_TraceBusID_Pos) |
60-
(1 << ITM_TCR_DWTENA_Pos) |
59+
ITM->TCR = (1 << ITM_TCR_TraceBusID_Pos) |
60+
(1 << ITM_TCR_DWTENA_Pos) |
6161
(1 << ITM_TCR_SYNCENA_Pos) |
6262
(1 << ITM_TCR_ITMENA_Pos);
6363

6464
/* Trace Enable Register */
65-
ITM->TER = SWO_STIMULUS_PORT;
65+
ITM->TER = SWO_STIMULUS_PORT;
6666
}
6767
}
6868

6969
uint32_t mbed_itm_send(uint32_t port, uint32_t data)
7070
{
7171
/* Check if ITM and port is enabled */
7272
if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */
73-
((ITM->TER & (1UL << port) ) != 0UL) ) /* ITM Port enabled */
74-
{
73+
((ITM->TER & (1UL << port)) != 0UL)) { /* ITM Port enabled */
7574
/* write data to port */
7675
ITM->PORT[port].u32 = data;
7776

0 commit comments

Comments
 (0)