[Style] Global style fix run.
This commit is contained in:
parent
67efedec54
commit
a909b5ca9e
@ -156,14 +156,17 @@ static inline bool cm_mask_faults(bool mask)
|
|||||||
|
|
||||||
#if !defined(__DOXYGEN__)
|
#if !defined(__DOXYGEN__)
|
||||||
/* Do not populate this definition outside */
|
/* Do not populate this definition outside */
|
||||||
static inline bool __cm_atomic_set(bool* val)
|
static inline bool __cm_atomic_set(bool *val)
|
||||||
{
|
{
|
||||||
return cm_mask_interrupts(*val);
|
return cm_mask_interrupts(*val);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define __CM_SAVER(state) __val = state, \
|
#define __CM_SAVER(state) \
|
||||||
|
do { \
|
||||||
|
__val = state, \
|
||||||
__save __attribute__((__cleanup__(__cm_atomic_set))) = \
|
__save __attribute__((__cleanup__(__cm_atomic_set))) = \
|
||||||
__cm_atomic_set(&__val)
|
__cm_atomic_set(&__val); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#endif /* !defined(__DOXYGEN) */
|
#endif /* !defined(__DOXYGEN) */
|
||||||
|
|
||||||
@ -214,7 +217,9 @@ static inline bool __cm_atomic_set(bool* val)
|
|||||||
#define CM_ATOMIC_BLOCK()
|
#define CM_ATOMIC_BLOCK()
|
||||||
#else /* defined(__DOXYGEN__) */
|
#else /* defined(__DOXYGEN__) */
|
||||||
#define CM_ATOMIC_BLOCK() \
|
#define CM_ATOMIC_BLOCK() \
|
||||||
for (bool ___CM_SAVER(true), __my = true; __my; __my = false)
|
do { \
|
||||||
|
for (bool ___CM_SAVER(true), __my = true; __my; __my = false); \
|
||||||
|
} while (0)
|
||||||
#endif /* defined(__DOXYGEN__) */
|
#endif /* defined(__DOXYGEN__) */
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
@ -32,7 +32,7 @@ void __dmb(void);
|
|||||||
/* --- Exclusive load and store instructions ------------------------------- */
|
/* --- Exclusive load and store instructions ------------------------------- */
|
||||||
|
|
||||||
/* Those are defined only on CM3 or CM4 */
|
/* Those are defined only on CM3 or CM4 */
|
||||||
#if defined(__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__)
|
#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
|
||||||
|
|
||||||
uint32_t __ldrex(volatile uint32_t *addr);
|
uint32_t __ldrex(volatile uint32_t *addr);
|
||||||
uint32_t __strex(uint32_t val, volatile uint32_t *addr);
|
uint32_t __strex(uint32_t val, volatile uint32_t *addr);
|
||||||
|
@ -749,5 +749,4 @@ END_DECLS
|
|||||||
|
|
||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -684,7 +684,7 @@ typedef struct {
|
|||||||
} sgpio_t;
|
} sgpio_t;
|
||||||
|
|
||||||
/* Global access to SGPIO structure */
|
/* Global access to SGPIO structure */
|
||||||
#define SGPIO ((sgpio_t*)SGPIO_PORT_BASE)
|
#define SGPIO ((sgpio_t *)SGPIO_PORT_BASE)
|
||||||
|
|
||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
||||||
|
@ -622,7 +622,7 @@ injected channels.
|
|||||||
#define ADC_JSQR_JSQ2_MSK (0x1f << ADC_JSQR_JSQ2_LSB)
|
#define ADC_JSQR_JSQ2_MSK (0x1f << ADC_JSQR_JSQ2_LSB)
|
||||||
#define ADC_JSQR_JSQ1_MSK (0x1f << ADC_JSQR_JSQ1_LSB)
|
#define ADC_JSQR_JSQ1_MSK (0x1f << ADC_JSQR_JSQ1_LSB)
|
||||||
|
|
||||||
#define ADC_JSQR_JSQ_VAL(n,val) ((val) << (((n) - 1) * 5))
|
#define ADC_JSQR_JSQ_VAL(n, val) ((val) << (((n) - 1) * 5))
|
||||||
#define ADC_JSQR_JL_VAL(val) (((val) - 1) << ADC_JSQR_JL_SHIFT)
|
#define ADC_JSQR_JL_VAL(val) (((val) - 1) << ADC_JSQR_JL_SHIFT)
|
||||||
|
|
||||||
/* --- ADC_JDRx, ADC_DR values --------------------------------------------- */
|
/* --- ADC_JDRx, ADC_DR values --------------------------------------------- */
|
||||||
|
@ -628,7 +628,7 @@
|
|||||||
#define ADC_JSQR_JSQ2_LSB 14
|
#define ADC_JSQR_JSQ2_LSB 14
|
||||||
#define ADC_JSQR_JSQ1_LSB 8
|
#define ADC_JSQR_JSQ1_LSB 8
|
||||||
|
|
||||||
#define ADC_JSQR_JSQ_VAL(n,val) ((val) << (((n) - 1) * 6 + 8))
|
#define ADC_JSQR_JSQ_VAL(n, val) ((val) << (((n) - 1) * 6 + 8))
|
||||||
#define ADC_JSQR_JL_VAL(val) (((val) - 1) << ADC_JSQR_JL_SHIFT)
|
#define ADC_JSQR_JL_VAL(val) (((val) - 1) << ADC_JSQR_JL_SHIFT)
|
||||||
|
|
||||||
/* Bits 30:26 JSQ4[4:0]: 4th conversion in the injected sequence */
|
/* Bits 30:26 JSQ4[4:0]: 4th conversion in the injected sequence */
|
||||||
|
@ -587,7 +587,7 @@ injected channels.
|
|||||||
#define ADC_JSQR_JSQ2_MSK (0x1f << ADC_JSQR_JSQ2_LSB)
|
#define ADC_JSQR_JSQ2_MSK (0x1f << ADC_JSQR_JSQ2_LSB)
|
||||||
#define ADC_JSQR_JSQ1_MSK (0x1f << ADC_JSQR_JSQ1_LSB)
|
#define ADC_JSQR_JSQ1_MSK (0x1f << ADC_JSQR_JSQ1_LSB)
|
||||||
|
|
||||||
#define ADC_JSQR_JSQ_VAL(n,val) ((val) << (((n) - 1) * 5))
|
#define ADC_JSQR_JSQ_VAL(n, val) ((val) << (((n) - 1) * 5))
|
||||||
#define ADC_JSQR_JL_VAL(val) (((val) - 1) << ADC_JSQR_JL_SHIFT)
|
#define ADC_JSQR_JL_VAL(val) (((val) - 1) << ADC_JSQR_JL_SHIFT)
|
||||||
|
|
||||||
/* --- ADC_JDRx, ADC_DR values --------------------------------------------- */
|
/* --- ADC_JDRx, ADC_DR values --------------------------------------------- */
|
||||||
|
@ -164,7 +164,7 @@ void nvic_set_priority(uint8_t irqn, uint8_t priority)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Those are defined only on CM3 or CM4 */
|
/* Those are defined only on CM3 or CM4 */
|
||||||
#if defined(__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__)
|
#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/** @brief NVIC Return Active Interrupt
|
/** @brief NVIC Return Active Interrupt
|
||||||
*
|
*
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <libopencm3/cm3/scb.h>
|
#include <libopencm3/cm3/scb.h>
|
||||||
|
|
||||||
/* Those are defined only on CM3 or CM4 */
|
/* Those are defined only on CM3 or CM4 */
|
||||||
#if defined(__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__)
|
#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
|
||||||
void scb_reset_core(void)
|
void scb_reset_core(void)
|
||||||
{
|
{
|
||||||
SCB_AIRCR = SCB_AIRCR_VECTKEY | SCB_AIRCR_VECTRESET;
|
SCB_AIRCR = SCB_AIRCR_VECTKEY | SCB_AIRCR_VECTRESET;
|
||||||
@ -39,7 +39,7 @@ void scb_reset_system(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Those are defined only on CM3 or CM4 */
|
/* Those are defined only on CM3 or CM4 */
|
||||||
#if defined(__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__)
|
#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
|
||||||
void scb_set_priority_grouping(uint32_t prigroup)
|
void scb_set_priority_grouping(uint32_t prigroup)
|
||||||
{
|
{
|
||||||
SCB_AIRCR = SCB_AIRCR_VECTKEY | prigroup;
|
SCB_AIRCR = SCB_AIRCR_VECTKEY | prigroup;
|
||||||
|
@ -44,7 +44,7 @@ vector_table_t vector_table = {
|
|||||||
.hard_fault = hard_fault_handler,
|
.hard_fault = hard_fault_handler,
|
||||||
|
|
||||||
/* Those are defined only on CM3 or CM4 */
|
/* Those are defined only on CM3 or CM4 */
|
||||||
#if defined(__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__)
|
#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
|
||||||
.memory_manage_fault = mem_manage_handler,
|
.memory_manage_fault = mem_manage_handler,
|
||||||
.bus_fault = bus_fault_handler,
|
.bus_fault = bus_fault_handler,
|
||||||
.usage_fault = usage_fault_handler,
|
.usage_fault = usage_fault_handler,
|
||||||
@ -112,7 +112,7 @@ void null_handler(void)
|
|||||||
#pragma weak sys_tick_handler = null_handler
|
#pragma weak sys_tick_handler = null_handler
|
||||||
|
|
||||||
/* Those are defined only on CM3 or CM4 */
|
/* Those are defined only on CM3 or CM4 */
|
||||||
#if defined(__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__)
|
#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
|
||||||
#pragma weak mem_manage_handler = blocking_handler
|
#pragma weak mem_manage_handler = blocking_handler
|
||||||
#pragma weak bus_fault_handler = blocking_handler
|
#pragma weak bus_fault_handler = blocking_handler
|
||||||
#pragma weak usage_fault_handler = blocking_handler
|
#pragma weak usage_fault_handler = blocking_handler
|
||||||
|
@ -93,7 +93,8 @@ void rcc_peripheral_reset(volatile uint32_t *reg, uint32_t reset)
|
|||||||
*
|
*
|
||||||
* @param[in] *reg Unsigned int32. Pointer to a Reset Register
|
* @param[in] *reg Unsigned int32. Pointer to a Reset Register
|
||||||
* (either RCC_AHBENR, RCC_APB1ENR or RCC_APB2ENR)
|
* (either RCC_AHBENR, RCC_APB1ENR or RCC_APB2ENR)
|
||||||
* @param[in] clear_reset Unsigned int32. Logical OR of all resets to be removed:
|
* @param[in] clear_reset Unsigned int32. Logical OR of all resets to be
|
||||||
|
* removed:
|
||||||
* @li If register is RCC_AHBRSTR, from @ref rcc_ahbrstr_rst
|
* @li If register is RCC_AHBRSTR, from @ref rcc_ahbrstr_rst
|
||||||
* @li If register is RCC_APB1RSTR, from @ref rcc_apb1rstr_rst
|
* @li If register is RCC_APB1RSTR, from @ref rcc_apb1rstr_rst
|
||||||
* @li If register is RCC_APB2RSTR, from @ref rcc_apb2rstr_rst
|
* @li If register is RCC_APB2RSTR, from @ref rcc_apb2rstr_rst
|
||||||
|
@ -788,7 +788,7 @@ void adc_enable_analog_watchdog_on_all_channels(uint32_t adc)
|
|||||||
|
|
||||||
void adc_enable_analog_watchdog_on_selected_channel(uint32_t adc, uint8_t chan)
|
void adc_enable_analog_watchdog_on_selected_channel(uint32_t adc, uint8_t chan)
|
||||||
{
|
{
|
||||||
ADC_CFGR1(adc) = (ADC_CFGR1(adc) & ~ADC_CFGR1_AWDCH) | \
|
ADC_CFGR1(adc) = (ADC_CFGR1(adc) & ~ADC_CFGR1_AWDCH) |
|
||||||
ADC_CFGR1_AWDCH_VAL(chan);
|
ADC_CFGR1_AWDCH_VAL(chan);
|
||||||
|
|
||||||
ADC_CFGR1(adc) |= ADC_CFGR1_AWDEN | ADC_CFGR1_AWDSGL;
|
ADC_CFGR1(adc) |= ADC_CFGR1_AWDEN | ADC_CFGR1_AWDSGL;
|
||||||
|
@ -250,7 +250,7 @@ void rcc_osc_on(enum rcc_osc osc)
|
|||||||
RCC_CSR |= RCC_CSR_LSION;
|
RCC_CSR |= RCC_CSR_LSION;
|
||||||
break;
|
break;
|
||||||
case PLL:
|
case PLL:
|
||||||
RCC_CR|=RCC_CR_PLLON;
|
RCC_CR |= RCC_CR_PLLON;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user