Changed to use stdint types.
This commit is contained in:
@@ -53,7 +53,7 @@ Enables a user interrupt.
|
||||
@param[in] irqn Unsigned int8. Interrupt number @ref nvic_stm32f1_userint
|
||||
*/
|
||||
|
||||
void nvic_enable_irq(u8 irqn)
|
||||
void nvic_enable_irq(uint8_t irqn)
|
||||
{
|
||||
NVIC_ISER(irqn / 32) = (1 << (irqn % 32));
|
||||
}
|
||||
@@ -66,7 +66,7 @@ Disables a user interrupt.
|
||||
@param[in] irqn Unsigned int8. Interrupt number @ref nvic_stm32f1_userint
|
||||
*/
|
||||
|
||||
void nvic_disable_irq(u8 irqn)
|
||||
void nvic_disable_irq(uint8_t irqn)
|
||||
{
|
||||
NVIC_ICER(irqn / 32) = (1 << (irqn % 32));
|
||||
}
|
||||
@@ -80,7 +80,7 @@ True if the interrupt has occurred and is waiting for service.
|
||||
@return Boolean. Interrupt pending.
|
||||
*/
|
||||
|
||||
u8 nvic_get_pending_irq(u8 irqn)
|
||||
uint8_t nvic_get_pending_irq(uint8_t irqn)
|
||||
{
|
||||
return NVIC_ISPR(irqn / 32) & (1 << (irqn % 32)) ? 1 : 0;
|
||||
}
|
||||
@@ -94,7 +94,7 @@ is already pending.
|
||||
@param[in] irqn Unsigned int8. Interrupt number @ref nvic_stm32f1_userint
|
||||
*/
|
||||
|
||||
void nvic_set_pending_irq(u8 irqn)
|
||||
void nvic_set_pending_irq(uint8_t irqn)
|
||||
{
|
||||
NVIC_ISPR(irqn / 32) = (1 << (irqn % 32));
|
||||
}
|
||||
@@ -108,7 +108,7 @@ interrupt is actively being serviced.
|
||||
@param[in] irqn Unsigned int8. Interrupt number @ref nvic_stm32f1_userint
|
||||
*/
|
||||
|
||||
void nvic_clear_pending_irq(u8 irqn)
|
||||
void nvic_clear_pending_irq(uint8_t irqn)
|
||||
{
|
||||
NVIC_ICPR(irqn / 32) = (1 << (irqn % 32));
|
||||
}
|
||||
@@ -122,7 +122,7 @@ Interrupt has occurred and is currently being serviced.
|
||||
@return Boolean. Interrupt active.
|
||||
*/
|
||||
|
||||
u8 nvic_get_active_irq(u8 irqn)
|
||||
uint8_t nvic_get_active_irq(uint8_t irqn)
|
||||
{
|
||||
return NVIC_IABR(irqn / 32) & (1 << (irqn % 32)) ? 1 : 0;
|
||||
}
|
||||
@@ -134,7 +134,7 @@ u8 nvic_get_active_irq(u8 irqn)
|
||||
@return Boolean. Interrupt enabled.
|
||||
*/
|
||||
|
||||
u8 nvic_get_irq_enabled(u8 irqn)
|
||||
uint8_t nvic_get_irq_enabled(uint8_t irqn)
|
||||
{
|
||||
return NVIC_ISER(irqn / 32) & (1 << (irqn % 32)) ? 1 : 0;
|
||||
}
|
||||
@@ -152,7 +152,7 @@ scb_set_priority_grouping.
|
||||
@param[in] priority Unsigned int8. Interrupt priority (0 ... 255 in steps of 16)
|
||||
*/
|
||||
|
||||
void nvic_set_priority(u8 irqn, u8 priority)
|
||||
void nvic_set_priority(uint8_t irqn, uint8_t priority)
|
||||
{
|
||||
/* code from lpc43xx/nvic.c -- this is quite a hack and alludes to the
|
||||
* negative interrupt numbers assigned to the system interrupts. better
|
||||
@@ -176,7 +176,7 @@ Registers.
|
||||
@param[in] irqn Unsigned int16. Interrupt number (0 ... 239)
|
||||
*/
|
||||
|
||||
void nvic_generate_software_interrupt(u16 irqn)
|
||||
void nvic_generate_software_interrupt(uint16_t irqn)
|
||||
{
|
||||
if (irqn <= 239) {
|
||||
NVIC_STIR |= irqn;
|
||||
|
||||
@@ -35,7 +35,7 @@ void scb_reset_system(void)
|
||||
while (1);
|
||||
}
|
||||
|
||||
void scb_set_priority_grouping(u32 prigroup)
|
||||
void scb_set_priority_grouping(uint32_t prigroup)
|
||||
{
|
||||
SCB_AIRCR = SCB_AIRCR_VECTKEY | prigroup;
|
||||
}
|
||||
|
||||
@@ -19,16 +19,16 @@
|
||||
|
||||
#include <libopencm3/cm3/sync.h>
|
||||
|
||||
u32 __ldrex(volatile u32 *addr)
|
||||
uint32_t __ldrex(volatile uint32_t *addr)
|
||||
{
|
||||
u32 res;
|
||||
uint32_t res;
|
||||
__asm__ volatile ("ldrex %0, [%1]" : "=r" (res) : "r" (addr));
|
||||
return res;
|
||||
}
|
||||
|
||||
u32 __strex(u32 val, volatile u32 *addr)
|
||||
uint32_t __strex(uint32_t val, volatile uint32_t *addr)
|
||||
{
|
||||
u32 res;
|
||||
uint32_t res;
|
||||
__asm__ volatile ("strex %0, %2, [%1]"
|
||||
: "=&r" (res) : "r" (addr), "r" (val));
|
||||
return res;
|
||||
@@ -41,7 +41,7 @@ void __dmb()
|
||||
|
||||
void mutex_lock(mutex_t *m)
|
||||
{
|
||||
u32 status = 0;
|
||||
uint32_t status = 0;
|
||||
|
||||
do {
|
||||
/* Wait until the mutex is unlocked. */
|
||||
|
||||
@@ -46,10 +46,10 @@ LGPL License Terms @ref lgpl_license
|
||||
The counter is set to the reload value when the counter starts and after it
|
||||
reaches zero.
|
||||
|
||||
@param[in] value u32. 24 bit reload value.
|
||||
@param[in] value uint32_t. 24 bit reload value.
|
||||
*/
|
||||
|
||||
void systick_set_reload(u32 value)
|
||||
void systick_set_reload(uint32_t value)
|
||||
{
|
||||
STK_LOAD = (value & 0x00FFFFFF);
|
||||
}
|
||||
@@ -57,10 +57,10 @@ void systick_set_reload(u32 value)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @brief SysTick Read the Automatic Reload Value.
|
||||
|
||||
@returns 24 bit reload value as u32.
|
||||
@returns 24 bit reload value as uint32_t.
|
||||
*/
|
||||
|
||||
u32 systick_get_reload(void)
|
||||
uint32_t systick_get_reload(void)
|
||||
{
|
||||
return STK_LOAD & 0x00FFFFFF;
|
||||
}
|
||||
@@ -68,10 +68,10 @@ u32 systick_get_reload(void)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @brief Get the current SysTick counter value.
|
||||
|
||||
@returns 24 bit current value as u32.
|
||||
@returns 24 bit current value as uint32_t.
|
||||
*/
|
||||
|
||||
u32 systick_get_value(void)
|
||||
uint32_t systick_get_value(void)
|
||||
{
|
||||
return STK_VAL & 0x00FFFFFF;
|
||||
}
|
||||
@@ -81,10 +81,10 @@ u32 systick_get_value(void)
|
||||
|
||||
The clock source can be either the AHB clock or the same clock divided by 8.
|
||||
|
||||
@param[in] clocksource u8. Clock source from @ref systick_clksource.
|
||||
@param[in] clocksource uint8_t. Clock source from @ref systick_clksource.
|
||||
*/
|
||||
|
||||
void systick_set_clocksource(u8 clocksource)
|
||||
void systick_set_clocksource(uint8_t clocksource)
|
||||
{
|
||||
if (clocksource < 2) {
|
||||
STK_CTRL |= (clocksource << STK_CTRL_CLKSOURCE_LSB);
|
||||
@@ -140,7 +140,7 @@ the flag is read.
|
||||
@returns Boolean if flag set.
|
||||
*/
|
||||
|
||||
u8 systick_get_countflag(void)
|
||||
uint8_t systick_get_countflag(void)
|
||||
{
|
||||
if (STK_CTRL & STK_CTRL_COUNTFLAG) {
|
||||
return 1;
|
||||
@@ -154,7 +154,7 @@ u8 systick_get_countflag(void)
|
||||
|
||||
@returns Current calibration value
|
||||
*/
|
||||
u32 systick_get_calib(void)
|
||||
uint32_t systick_get_calib(void)
|
||||
{
|
||||
return STK_CALIB & 0x00FFFFFF;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user