arch/sparc: Remove FAR from chip and board folder
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
977fa987e2
commit
6af167c086
@ -77,7 +77,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int bm3803_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
||||
static int bm3803_timerisr(int irq, uint32_t *regs, void *arg)
|
||||
{
|
||||
/* Clear the pending timer interrupt */
|
||||
|
||||
|
@ -173,7 +173,7 @@ static int bm3803_exti3_isr(int irq, void *context, void * arg)
|
||||
int bm3803_gpioset_irq(uint32_t pinset, bool enable, bool trig, bool edge,
|
||||
xcpt_t func, void *arg)
|
||||
{
|
||||
FAR struct gpio_callback_s *shared_cbs;
|
||||
struct gpio_callback_s *shared_cbs;
|
||||
uint32_t pin = pinset & 0x3;
|
||||
|
||||
uint32_t en = 0x80 << (pin * 8);
|
||||
|
@ -59,9 +59,9 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int bm3803_freerun_handler(int irq, FAR void *context, void *arg)
|
||||
static int bm3803_freerun_handler(int irq, void *context, void *arg)
|
||||
{
|
||||
FAR struct bm3803_freerun_s *freerun = (FAR struct bm3803_freerun_s *) arg;
|
||||
struct bm3803_freerun_s *freerun = (struct bm3803_freerun_s *) arg;
|
||||
|
||||
DEBUGASSERT(freerun != NULL && freerun->overflow < UINT24_MAX);
|
||||
freerun->overflow++;
|
||||
@ -92,7 +92,7 @@ static int bm3803_freerun_handler(int irq, FAR void *context, void *arg)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int bm3803_freerun_initialize(FAR struct bm3803_freerun_s *freerun, int chan,
|
||||
int bm3803_freerun_initialize(struct bm3803_freerun_s *freerun, int chan,
|
||||
uint16_t resolution)
|
||||
{
|
||||
uint32_t frequency;
|
||||
@ -156,8 +156,8 @@ int bm3803_freerun_initialize(FAR struct bm3803_freerun_s *freerun, int chan,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int bm3803_freerun_counter(FAR struct bm3803_freerun_s *freerun,
|
||||
FAR struct timespec *ts)
|
||||
int bm3803_freerun_counter(struct bm3803_freerun_s *freerun,
|
||||
struct timespec *ts)
|
||||
{
|
||||
uint64_t usec;
|
||||
uint32_t counter;
|
||||
@ -253,7 +253,7 @@ int bm3803_freerun_counter(FAR struct bm3803_freerun_s *freerun,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int bm3803_freerun_uninitialize(FAR struct bm3803_freerun_s *freerun)
|
||||
int bm3803_freerun_uninitialize(struct bm3803_freerun_s *freerun)
|
||||
{
|
||||
DEBUGASSERT(freerun && freerun->tch);
|
||||
|
||||
|
@ -47,10 +47,10 @@
|
||||
|
||||
struct bm3803_freerun_s
|
||||
{
|
||||
uint8_t chan; /* The timer/counter in use */
|
||||
bool running; /* True: the timer is running */
|
||||
uint32_t overflow; /* Timer counter overflow */
|
||||
FAR struct bm3803_tim_dev_s *tch; /* Handle returned by bm3803_tim_init() */
|
||||
uint8_t chan; /* The timer/counter in use */
|
||||
bool running; /* True: the timer is running */
|
||||
uint32_t overflow; /* Timer counter overflow */
|
||||
struct bm3803_tim_dev_s *tch; /* Handle returned by bm3803_tim_init() */
|
||||
uint32_t frequency;
|
||||
};
|
||||
|
||||
|
@ -73,7 +73,7 @@ static int bm3803_oneshot_handler(int irq, void *context, void *arg)
|
||||
{
|
||||
struct bm3803_oneshot_s *oneshot = (struct bm3803_oneshot_s *) arg;
|
||||
oneshot_handler_t oneshot_handler;
|
||||
FAR void *oneshot_arg;
|
||||
void *oneshot_arg;
|
||||
|
||||
tmrinfo("Expired...\n");
|
||||
DEBUGASSERT(oneshot != NULL && oneshot->handler);
|
||||
@ -124,7 +124,7 @@ static int bm3803_oneshot_handler(int irq, void *context, void *arg)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int bm3803_oneshot_initialize(FAR struct bm3803_oneshot_s *oneshot,
|
||||
int bm3803_oneshot_initialize(struct bm3803_oneshot_s *oneshot,
|
||||
int chan, uint16_t resolution)
|
||||
{
|
||||
uint32_t frequency;
|
||||
@ -166,8 +166,8 @@ int bm3803_oneshot_initialize(FAR struct bm3803_oneshot_s *oneshot,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int bm3803_oneshot_max_delay(FAR struct bm3803_oneshot_s *oneshot,
|
||||
FAR uint64_t *usec)
|
||||
int bm3803_oneshot_max_delay(struct bm3803_oneshot_s *oneshot,
|
||||
uint64_t *usec)
|
||||
{
|
||||
DEBUGASSERT(oneshot != NULL && usec != NULL);
|
||||
|
||||
@ -196,9 +196,9 @@ int bm3803_oneshot_max_delay(FAR struct bm3803_oneshot_s *oneshot,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int bm3803_oneshot_start(FAR struct bm3803_oneshot_s *oneshot,
|
||||
oneshot_handler_t handler, FAR void *arg,
|
||||
FAR const struct timespec *ts)
|
||||
int bm3803_oneshot_start(struct bm3803_oneshot_s *oneshot,
|
||||
oneshot_handler_t handler, void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
uint64_t usec;
|
||||
uint64_t period;
|
||||
@ -292,8 +292,8 @@ int bm3803_oneshot_start(FAR struct bm3803_oneshot_s *oneshot,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int bm3803_oneshot_cancel(FAR struct bm3803_oneshot_s *oneshot,
|
||||
FAR struct timespec *ts)
|
||||
int bm3803_oneshot_cancel(struct bm3803_oneshot_s *oneshot,
|
||||
struct timespec *ts)
|
||||
{
|
||||
irqstate_t flags;
|
||||
uint64_t usec;
|
||||
|
@ -63,7 +63,7 @@ struct bm3803_oneshot_s
|
||||
uint8_t chan; /* The timer/counter in use */
|
||||
|
||||
volatile bool running; /* True: the timer is running */
|
||||
FAR struct bm3803_tim_dev_s *tch; /* Pointer returned by
|
||||
struct bm3803_tim_dev_s *tch; /* Pointer returned by
|
||||
* bm3803_tim_init() */
|
||||
volatile oneshot_handler_t handler; /* Oneshot expiration callback */
|
||||
volatile void *arg; /* The argument that will accompany
|
||||
|
@ -51,7 +51,7 @@ struct bm3803_oneshot_lowerhalf_s
|
||||
* compatible to struct bm3803_oneshot_lowerhalf_s and vice versa.
|
||||
*/
|
||||
|
||||
struct oneshot_lowerhalf_s lh; /* Common lower-half driver fields */
|
||||
struct oneshot_lowerhalf_s lh; /* Common lower-half driver fields */
|
||||
|
||||
/* Private lower half data follows */
|
||||
|
||||
@ -59,7 +59,7 @@ struct bm3803_oneshot_lowerhalf_s
|
||||
|
||||
struct bm3803_oneshot_s oneshot;
|
||||
oneshot_callback_t callback; /* internal handler that receives callback */
|
||||
FAR void *arg; /* Argument that is passed to the handler */
|
||||
void *arg; /* Argument that is passed to the handler */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
@ -68,13 +68,13 @@ struct bm3803_oneshot_lowerhalf_s
|
||||
|
||||
static void bm3803_oneshot_handler(void *arg);
|
||||
|
||||
static int bm3803_max_delay(FAR struct oneshot_lowerhalf_s *lower,
|
||||
FAR struct timespec *ts);
|
||||
static int bm3803_start(FAR struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, FAR void *arg,
|
||||
FAR const struct timespec *ts);
|
||||
static int bm3803_cancel(FAR struct oneshot_lowerhalf_s *lower,
|
||||
FAR struct timespec *ts);
|
||||
static int bm3803_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int bm3803_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts);
|
||||
static int bm3803_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
@ -110,10 +110,10 @@ static const struct oneshot_operations_s g_oneshot_ops =
|
||||
|
||||
static void bm3803_oneshot_handler(void *arg)
|
||||
{
|
||||
FAR struct bm3803_oneshot_lowerhalf_s *priv =
|
||||
(FAR struct bm3803_oneshot_lowerhalf_s *)arg;
|
||||
struct bm3803_oneshot_lowerhalf_s *priv =
|
||||
(struct bm3803_oneshot_lowerhalf_s *)arg;
|
||||
oneshot_callback_t callback;
|
||||
FAR void *cbarg;
|
||||
void *cbarg;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
|
||||
@ -156,11 +156,11 @@ static void bm3803_oneshot_handler(void *arg)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int bm3803_max_delay(FAR struct oneshot_lowerhalf_s *lower,
|
||||
FAR struct timespec *ts)
|
||||
static int bm3803_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts)
|
||||
{
|
||||
FAR struct bm3803_oneshot_lowerhalf_s *priv =
|
||||
(FAR struct bm3803_oneshot_lowerhalf_s *)lower;
|
||||
struct bm3803_oneshot_lowerhalf_s *priv =
|
||||
(struct bm3803_oneshot_lowerhalf_s *)lower;
|
||||
uint64_t usecs;
|
||||
int ret;
|
||||
|
||||
@ -198,12 +198,12 @@ static int bm3803_max_delay(FAR struct oneshot_lowerhalf_s *lower,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int bm3803_start(FAR struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, FAR void *arg,
|
||||
FAR const struct timespec *ts)
|
||||
static int bm3803_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
FAR struct bm3803_oneshot_lowerhalf_s *priv =
|
||||
(FAR struct bm3803_oneshot_lowerhalf_s *)lower;
|
||||
struct bm3803_oneshot_lowerhalf_s *priv =
|
||||
(struct bm3803_oneshot_lowerhalf_s *)lower;
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
@ -250,11 +250,11 @@ static int bm3803_start(FAR struct oneshot_lowerhalf_s *lower,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int bm3803_cancel(FAR struct oneshot_lowerhalf_s *lower,
|
||||
FAR struct timespec *ts)
|
||||
static int bm3803_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts)
|
||||
{
|
||||
FAR struct bm3803_oneshot_lowerhalf_s *priv =
|
||||
(FAR struct bm3803_oneshot_lowerhalf_s *)lower;
|
||||
struct bm3803_oneshot_lowerhalf_s *priv =
|
||||
(struct bm3803_oneshot_lowerhalf_s *)lower;
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
@ -299,15 +299,15 @@ static int bm3803_cancel(FAR struct oneshot_lowerhalf_s *lower,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct oneshot_lowerhalf_s *oneshot_initialize(int chan,
|
||||
struct oneshot_lowerhalf_s *oneshot_initialize(int chan,
|
||||
uint16_t resolution)
|
||||
{
|
||||
FAR struct bm3803_oneshot_lowerhalf_s *priv;
|
||||
struct bm3803_oneshot_lowerhalf_s *priv;
|
||||
int ret;
|
||||
|
||||
/* Allocate an instance of the lower half driver */
|
||||
|
||||
priv = (FAR struct bm3803_oneshot_lowerhalf_s *)
|
||||
priv = (struct bm3803_oneshot_lowerhalf_s *)
|
||||
kmm_zalloc(sizeof(struct bm3803_oneshot_lowerhalf_s));
|
||||
|
||||
if (priv == NULL)
|
||||
|
@ -27,10 +27,10 @@
|
||||
*
|
||||
* void up_timer_initialize(void): Initializes the timer facilities.
|
||||
* Called early in the initialization sequence (by up_initialize()).
|
||||
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
||||
* int up_timer_gettime(struct timespec *ts): Returns the current
|
||||
* time from the platform specific time source.
|
||||
* int up_timer_cancel(void): Cancels the interval timer.
|
||||
* int up_timer_start(FAR const struct timespec *ts): Start (or re-starts)
|
||||
* int up_timer_start(const struct timespec *ts): Start (or re-starts)
|
||||
* the interval timer.
|
||||
*
|
||||
* The RTOS will provide the following interfaces for use by the platform-
|
||||
@ -139,7 +139,7 @@ static struct bm3803_tickless_s g_tickless;
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void bm3803_oneshot_handler(FAR void *arg)
|
||||
static void bm3803_oneshot_handler(void *arg)
|
||||
{
|
||||
tmrinfo("Expired...\n");
|
||||
nxsched_timer_expiration();
|
||||
@ -235,7 +235,7 @@ void up_timer_initialize(void)
|
||||
* up_timer_initialize() was called). This function is functionally
|
||||
* equivalent to:
|
||||
*
|
||||
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
||||
* int clock_gettime(clockid_t clockid, struct timespec *ts);
|
||||
*
|
||||
* when clockid is CLOCK_MONOTONIC.
|
||||
*
|
||||
@ -260,7 +260,7 @@ void up_timer_initialize(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timer_gettime(FAR struct timespec *ts)
|
||||
int up_timer_gettime(struct timespec *ts)
|
||||
{
|
||||
return bm3803_freerun_counter(&g_tickless.freerun, ts);
|
||||
}
|
||||
@ -301,7 +301,7 @@ int up_timer_gettime(FAR struct timespec *ts)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timer_cancel(FAR struct timespec *ts)
|
||||
int up_timer_cancel(struct timespec *ts)
|
||||
{
|
||||
return bm3803_oneshot_cancel(&g_tickless.oneshot, ts);
|
||||
}
|
||||
@ -331,7 +331,7 @@ int up_timer_cancel(FAR struct timespec *ts)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timer_start(FAR const struct timespec *ts)
|
||||
int up_timer_start(const struct timespec *ts)
|
||||
{
|
||||
return bm3803_oneshot_start(&g_tickless.oneshot, bm3803_oneshot_handler,
|
||||
NULL, ts);
|
||||
|
@ -59,7 +59,7 @@
|
||||
|
||||
struct bm3803_tim_priv_s
|
||||
{
|
||||
FAR const struct bm3803_tim_ops_s *ops;
|
||||
const struct bm3803_tim_ops_s *ops;
|
||||
enum bm3803_tim_mode_e mode;
|
||||
uint32_t base; /* TIMn base address */
|
||||
};
|
||||
@ -70,43 +70,43 @@ struct bm3803_tim_priv_s
|
||||
|
||||
/* Register helpers */
|
||||
|
||||
static inline uint16_t bm3803_getreg16(FAR struct bm3803_tim_dev_s *dev,
|
||||
static inline uint16_t bm3803_getreg16(struct bm3803_tim_dev_s *dev,
|
||||
uint8_t offset);
|
||||
static inline void bm3803_putreg16(FAR struct bm3803_tim_dev_s *dev,
|
||||
static inline void bm3803_putreg16(struct bm3803_tim_dev_s *dev,
|
||||
uint8_t offset, uint16_t value);
|
||||
static inline void bm3803_modifyreg32(FAR struct bm3803_tim_dev_s *dev,
|
||||
static inline void bm3803_modifyreg32(struct bm3803_tim_dev_s *dev,
|
||||
uint8_t offset, uint32_t clearbits,
|
||||
uint32_t setbits);
|
||||
static inline uint32_t bm3803_getreg32(FAR struct bm3803_tim_dev_s *dev,
|
||||
static inline uint32_t bm3803_getreg32(struct bm3803_tim_dev_s *dev,
|
||||
uint8_t offset);
|
||||
static inline void bm3803_putreg32(FAR struct bm3803_tim_dev_s *dev,
|
||||
static inline void bm3803_putreg32(struct bm3803_tim_dev_s *dev,
|
||||
uint8_t offset, uint32_t value);
|
||||
|
||||
/* Timer helpers */
|
||||
|
||||
static void bm3803_tim_reload_counter(FAR struct bm3803_tim_dev_s *dev);
|
||||
static void bm3803_tim_enable(FAR struct bm3803_tim_dev_s *dev);
|
||||
static void bm3803_tim_disable(FAR struct bm3803_tim_dev_s *dev);
|
||||
static void bm3803_tim_reset(FAR struct bm3803_tim_dev_s *dev);
|
||||
static void bm3803_tim_reload_counter(struct bm3803_tim_dev_s *dev);
|
||||
static void bm3803_tim_enable(struct bm3803_tim_dev_s *dev);
|
||||
static void bm3803_tim_disable(struct bm3803_tim_dev_s *dev);
|
||||
static void bm3803_tim_reset(struct bm3803_tim_dev_s *dev);
|
||||
|
||||
/* Timer methods */
|
||||
|
||||
static int bm3803_tim_setmode(FAR struct bm3803_tim_dev_s *dev,
|
||||
static int bm3803_tim_setmode(struct bm3803_tim_dev_s *dev,
|
||||
enum bm3803_tim_mode_e mode);
|
||||
|
||||
static int bm3803_tim_setclock(FAR struct bm3803_tim_dev_s *dev,
|
||||
static int bm3803_tim_setclock(struct bm3803_tim_dev_s *dev,
|
||||
uint32_t freq);
|
||||
static uint32_t bm3803_tim_getclock(FAR struct bm3803_tim_dev_s *dev);
|
||||
static void bm3803_tim_setperiod(FAR struct bm3803_tim_dev_s *dev,
|
||||
static uint32_t bm3803_tim_getclock(struct bm3803_tim_dev_s *dev);
|
||||
static void bm3803_tim_setperiod(struct bm3803_tim_dev_s *dev,
|
||||
uint32_t period);
|
||||
static uint32_t bm3803_tim_getperiod(FAR struct bm3803_tim_dev_s *dev);
|
||||
static uint32_t bm3803_tim_getcounter(FAR struct bm3803_tim_dev_s *dev);
|
||||
static uint32_t bm3803_tim_getperiod(struct bm3803_tim_dev_s *dev);
|
||||
static uint32_t bm3803_tim_getcounter(struct bm3803_tim_dev_s *dev);
|
||||
|
||||
static int bm3803_tim_setisr(FAR struct bm3803_tim_dev_s *dev,
|
||||
static int bm3803_tim_setisr(struct bm3803_tim_dev_s *dev,
|
||||
xcpt_t handler, void *arg, int source);
|
||||
|
||||
static int bm3803_tim_checkint(FAR struct bm3803_tim_dev_s *dev, int source);
|
||||
static void bm3803_tim_clrint(FAR struct bm3803_tim_dev_s *dev, int source);
|
||||
static int bm3803_tim_checkint(struct bm3803_tim_dev_s *dev, int source);
|
||||
static void bm3803_tim_clrint(struct bm3803_tim_dev_s *dev, int source);
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
@ -153,7 +153,7 @@ struct bm3803_tim_priv_s bm3803_tim2_priv =
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline uint16_t bm3803_getreg16(FAR struct bm3803_tim_dev_s *dev,
|
||||
static inline uint16_t bm3803_getreg16(struct bm3803_tim_dev_s *dev,
|
||||
uint8_t offset)
|
||||
{
|
||||
return getreg16(((struct bm3803_tim_priv_s *)dev)->base + offset);
|
||||
@ -167,7 +167,7 @@ static inline uint16_t bm3803_getreg16(FAR struct bm3803_tim_dev_s *dev,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void bm3803_putreg16(FAR struct bm3803_tim_dev_s *dev,
|
||||
static inline void bm3803_putreg16(struct bm3803_tim_dev_s *dev,
|
||||
uint8_t offset, uint16_t value)
|
||||
{
|
||||
putreg16(value, ((struct bm3803_tim_priv_s *)dev)->base + offset);
|
||||
@ -181,7 +181,7 @@ static inline void bm3803_putreg16(FAR struct bm3803_tim_dev_s *dev,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void bm3803_modifyreg32(FAR struct bm3803_tim_dev_s *dev,
|
||||
static inline void bm3803_modifyreg32(struct bm3803_tim_dev_s *dev,
|
||||
uint8_t offset, uint32_t clearbits,
|
||||
uint32_t setbits)
|
||||
{
|
||||
@ -198,7 +198,7 @@ static inline void bm3803_modifyreg32(FAR struct bm3803_tim_dev_s *dev,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline uint32_t bm3803_getreg32(FAR struct bm3803_tim_dev_s *dev,
|
||||
static inline uint32_t bm3803_getreg32(struct bm3803_tim_dev_s *dev,
|
||||
uint8_t offset)
|
||||
{
|
||||
return getreg32(((struct bm3803_tim_priv_s *)dev)->base + offset);
|
||||
@ -213,7 +213,7 @@ static inline uint32_t bm3803_getreg32(FAR struct bm3803_tim_dev_s *dev,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void bm3803_putreg32(FAR struct bm3803_tim_dev_s *dev,
|
||||
static inline void bm3803_putreg32(struct bm3803_tim_dev_s *dev,
|
||||
uint8_t offset, uint32_t value)
|
||||
{
|
||||
putreg32(value, ((struct bm3803_tim_priv_s *)dev)->base + offset);
|
||||
@ -223,7 +223,7 @@ static inline void bm3803_putreg32(FAR struct bm3803_tim_dev_s *dev,
|
||||
* Name: bm3803_tim_reload_counter
|
||||
****************************************************************************/
|
||||
|
||||
static void bm3803_tim_reload_counter(FAR struct bm3803_tim_dev_s *dev)
|
||||
static void bm3803_tim_reload_counter(struct bm3803_tim_dev_s *dev)
|
||||
{
|
||||
uint32_t val = bm3803_getreg32(dev, BM3803_TIM_CR_OFFSET);
|
||||
val |= TIMER_LOADCOUNT;
|
||||
@ -234,7 +234,7 @@ static void bm3803_tim_reload_counter(FAR struct bm3803_tim_dev_s *dev)
|
||||
* Name: bm3803_tim_enable
|
||||
****************************************************************************/
|
||||
|
||||
static void bm3803_tim_enable(FAR struct bm3803_tim_dev_s *dev)
|
||||
static void bm3803_tim_enable(struct bm3803_tim_dev_s *dev)
|
||||
{
|
||||
uint32_t val = bm3803_getreg32(dev, BM3803_TIM_CR_OFFSET);
|
||||
val |= TIMER_ENABLE | TIMER_RELOADCOUNT;
|
||||
@ -246,7 +246,7 @@ static void bm3803_tim_enable(FAR struct bm3803_tim_dev_s *dev)
|
||||
* Name: bm3803_tim_disable
|
||||
****************************************************************************/
|
||||
|
||||
static void bm3803_tim_disable(FAR struct bm3803_tim_dev_s *dev)
|
||||
static void bm3803_tim_disable(struct bm3803_tim_dev_s *dev)
|
||||
{
|
||||
uint32_t val = bm3803_getreg32(dev, BM3803_TIM_CR_OFFSET);
|
||||
val &= ~TIMER_ENABLE;
|
||||
@ -261,7 +261,7 @@ static void bm3803_tim_disable(FAR struct bm3803_tim_dev_s *dev)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void bm3803_tim_reset(FAR struct bm3803_tim_dev_s *dev)
|
||||
static void bm3803_tim_reset(struct bm3803_tim_dev_s *dev)
|
||||
{
|
||||
((struct bm3803_tim_priv_s *)dev)->mode = BM3803_TIM_MODE_DISABLED;
|
||||
bm3803_tim_disable(dev);
|
||||
@ -271,7 +271,7 @@ static void bm3803_tim_reset(FAR struct bm3803_tim_dev_s *dev)
|
||||
* Name: bm3803_tim_setmode
|
||||
****************************************************************************/
|
||||
|
||||
static int bm3803_tim_setmode(FAR struct bm3803_tim_dev_s *dev,
|
||||
static int bm3803_tim_setmode(struct bm3803_tim_dev_s *dev,
|
||||
enum bm3803_tim_mode_e mode)
|
||||
{
|
||||
uint32_t val = bm3803_getreg32(dev, BM3803_TIM_CR_OFFSET);
|
||||
@ -304,7 +304,7 @@ static int bm3803_tim_setmode(FAR struct bm3803_tim_dev_s *dev,
|
||||
* Name: bm3803_tim_setclock
|
||||
****************************************************************************/
|
||||
|
||||
static int bm3803_tim_setclock(FAR struct bm3803_tim_dev_s *dev,
|
||||
static int bm3803_tim_setclock(struct bm3803_tim_dev_s *dev,
|
||||
uint32_t freq)
|
||||
{
|
||||
uint32_t freqin;
|
||||
@ -377,7 +377,7 @@ static int bm3803_tim_setclock(FAR struct bm3803_tim_dev_s *dev,
|
||||
* Name: bm3803_tim_getclock
|
||||
****************************************************************************/
|
||||
|
||||
static uint32_t bm3803_tim_getclock(FAR struct bm3803_tim_dev_s *dev)
|
||||
static uint32_t bm3803_tim_getclock(struct bm3803_tim_dev_s *dev)
|
||||
{
|
||||
uint32_t freqin;
|
||||
uint32_t clock;
|
||||
@ -418,7 +418,7 @@ static uint32_t bm3803_tim_getclock(FAR struct bm3803_tim_dev_s *dev)
|
||||
* Name: bm3803_tim_setperiod
|
||||
****************************************************************************/
|
||||
|
||||
static void bm3803_tim_setperiod(FAR struct bm3803_tim_dev_s *dev,
|
||||
static void bm3803_tim_setperiod(struct bm3803_tim_dev_s *dev,
|
||||
uint32_t period)
|
||||
{
|
||||
DEBUGASSERT(dev != NULL);
|
||||
@ -430,7 +430,7 @@ static void bm3803_tim_setperiod(FAR struct bm3803_tim_dev_s *dev,
|
||||
* Name: bm3803_tim_getperiod
|
||||
****************************************************************************/
|
||||
|
||||
static uint32_t bm3803_tim_getperiod (FAR struct bm3803_tim_dev_s *dev)
|
||||
static uint32_t bm3803_tim_getperiod (struct bm3803_tim_dev_s *dev)
|
||||
{
|
||||
DEBUGASSERT(dev != NULL);
|
||||
return 0xffffff & bm3803_getreg32(dev, BM3803_TIM_ARR_OFFSET);
|
||||
@ -440,7 +440,7 @@ static uint32_t bm3803_tim_getperiod (FAR struct bm3803_tim_dev_s *dev)
|
||||
* Name: bm3803_tim_getcounter
|
||||
****************************************************************************/
|
||||
|
||||
static uint32_t bm3803_tim_getcounter(FAR struct bm3803_tim_dev_s *dev)
|
||||
static uint32_t bm3803_tim_getcounter(struct bm3803_tim_dev_s *dev)
|
||||
{
|
||||
DEBUGASSERT(dev != NULL);
|
||||
uint32_t counter = bm3803_getreg32(dev, BM3803_TIM_CNT_OFFSET);
|
||||
@ -452,7 +452,7 @@ static uint32_t bm3803_tim_getcounter(FAR struct bm3803_tim_dev_s *dev)
|
||||
* Name: bm3803_tim_setisr
|
||||
****************************************************************************/
|
||||
|
||||
static int bm3803_tim_setisr(FAR struct bm3803_tim_dev_s *dev,
|
||||
static int bm3803_tim_setisr(struct bm3803_tim_dev_s *dev,
|
||||
xcpt_t handler, void *arg, int source)
|
||||
{
|
||||
int vectorno;
|
||||
@ -500,7 +500,7 @@ static int bm3803_tim_setisr(FAR struct bm3803_tim_dev_s *dev,
|
||||
* Name: bm3803_tim_clrint
|
||||
****************************************************************************/
|
||||
|
||||
static void bm3803_tim_clrint(FAR struct bm3803_tim_dev_s *dev, int source)
|
||||
static void bm3803_tim_clrint(struct bm3803_tim_dev_s *dev, int source)
|
||||
{
|
||||
int vectorno;
|
||||
|
||||
@ -532,7 +532,7 @@ static void bm3803_tim_clrint(FAR struct bm3803_tim_dev_s *dev, int source)
|
||||
* Name: bm3803_tim_checkint
|
||||
****************************************************************************/
|
||||
|
||||
static int bm3803_tim_checkint(FAR struct bm3803_tim_dev_s *dev, int source)
|
||||
static int bm3803_tim_checkint(struct bm3803_tim_dev_s *dev, int source)
|
||||
{
|
||||
int vectorno;
|
||||
|
||||
@ -568,7 +568,7 @@ static int bm3803_tim_checkint(FAR struct bm3803_tim_dev_s *dev, int source)
|
||||
* Name: bm3803_tim_init
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct bm3803_tim_dev_s *bm3803_tim_init(int timer)
|
||||
struct bm3803_tim_dev_s *bm3803_tim_init(int timer)
|
||||
{
|
||||
struct bm3803_tim_dev_s *dev = NULL;
|
||||
|
||||
@ -613,7 +613,7 @@ FAR struct bm3803_tim_dev_s *bm3803_tim_init(int timer)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int bm3803_tim_deinit(FAR struct bm3803_tim_dev_s *dev)
|
||||
int bm3803_tim_deinit(struct bm3803_tim_dev_s *dev)
|
||||
{
|
||||
DEBUGASSERT(dev != NULL);
|
||||
|
||||
|
@ -99,29 +99,29 @@ struct bm3803_tim_ops_s
|
||||
{
|
||||
/* Basic Timers */
|
||||
|
||||
int (*setmode)(FAR struct bm3803_tim_dev_s *dev,
|
||||
int (*setmode)(struct bm3803_tim_dev_s *dev,
|
||||
enum bm3803_tim_mode_e mode);
|
||||
int (*setclock)(FAR struct bm3803_tim_dev_s *dev, uint32_t freq);
|
||||
uint32_t (*getclock)(FAR struct bm3803_tim_dev_s *dev);
|
||||
void (*setperiod)(FAR struct bm3803_tim_dev_s *dev, uint32_t period);
|
||||
uint32_t (*getperiod)(FAR struct bm3803_tim_dev_s *dev);
|
||||
uint32_t (*getcounter)(FAR struct bm3803_tim_dev_s *dev);
|
||||
int (*setclock)(struct bm3803_tim_dev_s *dev, uint32_t freq);
|
||||
uint32_t (*getclock)(struct bm3803_tim_dev_s *dev);
|
||||
void (*setperiod)(struct bm3803_tim_dev_s *dev, uint32_t period);
|
||||
uint32_t (*getperiod)(struct bm3803_tim_dev_s *dev);
|
||||
uint32_t (*getcounter)(struct bm3803_tim_dev_s *dev);
|
||||
|
||||
/* Timer interrupts */
|
||||
|
||||
int (*setisr)(FAR struct bm3803_tim_dev_s *dev,
|
||||
int (*setisr)(struct bm3803_tim_dev_s *dev,
|
||||
xcpt_t handler, void *arg, int source);
|
||||
void (*clrint)(FAR struct bm3803_tim_dev_s *dev, int source);
|
||||
int (*checkint)(FAR struct bm3803_tim_dev_s *dev, int source);
|
||||
void (*clrint)(struct bm3803_tim_dev_s *dev, int source);
|
||||
int (*checkint)(struct bm3803_tim_dev_s *dev, int source);
|
||||
};
|
||||
|
||||
/* Power-up timer and get its structure */
|
||||
|
||||
FAR struct bm3803_tim_dev_s *bm3803_tim_init(int timer);
|
||||
struct bm3803_tim_dev_s *bm3803_tim_init(int timer);
|
||||
|
||||
/* Power-down timer, mark it as unused */
|
||||
|
||||
int bm3803_tim_deinit(FAR struct bm3803_tim_dev_s *dev);
|
||||
int bm3803_tim_deinit(struct bm3803_tim_dev_s *dev);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: bm3803_timer_initialize
|
||||
@ -142,7 +142,7 @@ int bm3803_tim_deinit(FAR struct bm3803_tim_dev_s *dev);
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_TIMER
|
||||
int bm3803_timer_initialize(FAR const char *devpath, int timer);
|
||||
int bm3803_timer_initialize(const char *devpath, int timer);
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
|
@ -58,15 +58,15 @@
|
||||
|
||||
struct bm3803_lowerhalf_s
|
||||
{
|
||||
FAR const struct timer_ops_s *ops; /* Lower half operations */
|
||||
FAR struct bm3803_tim_dev_s *tim; /* stm32 timer driver */
|
||||
tccb_t callback; /* Current upper half interrupt
|
||||
* callback */
|
||||
FAR void *arg; /* Argument passed to upper half
|
||||
* callback */
|
||||
bool started; /* True: Timer has been started */
|
||||
const uint8_t resolution; /* Number of bits in the timer
|
||||
* (16 or 32 bits) */
|
||||
const struct timer_ops_s *ops; /* Lower half operations */
|
||||
struct bm3803_tim_dev_s *tim; /* stm32 timer driver */
|
||||
tccb_t callback; /* Current upper half interrupt
|
||||
* callback */
|
||||
void *arg; /* Argument passed to upper half
|
||||
* callback */
|
||||
bool started; /* True: Timer has been started */
|
||||
const uint8_t resolution; /* Number of bits in the timer
|
||||
* (16 or 32 bits) */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
@ -79,14 +79,14 @@ static int bm3803_timer_handler(int irq, void *context, void *arg);
|
||||
|
||||
/* "Lower half" driver methods **********************************************/
|
||||
|
||||
static int bm3803_start(FAR struct timer_lowerhalf_s *lower);
|
||||
static int bm3803_stop(FAR struct timer_lowerhalf_s *lower);
|
||||
static int bm3803_getstatus(FAR struct timer_lowerhalf_s *lower,
|
||||
FAR struct timer_status_s *status);
|
||||
static int bm3803_settimeout(FAR struct timer_lowerhalf_s *lower,
|
||||
static int bm3803_start(struct timer_lowerhalf_s *lower);
|
||||
static int bm3803_stop(struct timer_lowerhalf_s *lower);
|
||||
static int bm3803_getstatus(struct timer_lowerhalf_s *lower,
|
||||
struct timer_status_s *status);
|
||||
static int bm3803_settimeout(struct timer_lowerhalf_s *lower,
|
||||
uint32_t timeout);
|
||||
static void bm3803_setcallback(FAR struct timer_lowerhalf_s *lower,
|
||||
tccb_t callback, FAR void *arg);
|
||||
static void bm3803_setcallback(struct timer_lowerhalf_s *lower,
|
||||
tccb_t callback, void *arg);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
@ -138,8 +138,8 @@ static struct bm3803_lowerhalf_s g_tim2_lowerhalf =
|
||||
|
||||
static int bm3803_timer_handler(int irq, void *context, void *arg)
|
||||
{
|
||||
FAR struct bm3803_lowerhalf_s *lower =
|
||||
(FAR struct bm3803_lowerhalf_s *)arg;
|
||||
struct bm3803_lowerhalf_s *lower =
|
||||
(struct bm3803_lowerhalf_s *)arg;
|
||||
uint32_t next_interval_us = 0;
|
||||
|
||||
BM3803_TIM_ACKINT(lower->tim, 0);
|
||||
@ -174,10 +174,10 @@ static int bm3803_timer_handler(int irq, void *context, void *arg)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int bm3803_start(FAR struct timer_lowerhalf_s *lower)
|
||||
static int bm3803_start(struct timer_lowerhalf_s *lower)
|
||||
{
|
||||
FAR struct bm3803_lowerhalf_s *priv =
|
||||
(FAR struct bm3803_lowerhalf_s *)lower;
|
||||
struct bm3803_lowerhalf_s *priv =
|
||||
(struct bm3803_lowerhalf_s *)lower;
|
||||
|
||||
if (!priv->started)
|
||||
{
|
||||
@ -212,10 +212,10 @@ static int bm3803_start(FAR struct timer_lowerhalf_s *lower)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int bm3803_stop(FAR struct timer_lowerhalf_s *lower)
|
||||
static int bm3803_stop(struct timer_lowerhalf_s *lower)
|
||||
{
|
||||
FAR struct bm3803_lowerhalf_s *priv =
|
||||
(FAR struct bm3803_lowerhalf_s *)lower;
|
||||
struct bm3803_lowerhalf_s *priv =
|
||||
(struct bm3803_lowerhalf_s *)lower;
|
||||
|
||||
if (priv->started)
|
||||
{
|
||||
@ -246,11 +246,11 @@ static int bm3803_stop(FAR struct timer_lowerhalf_s *lower)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int bm3803_getstatus(FAR struct timer_lowerhalf_s *lower,
|
||||
FAR struct timer_status_s *status)
|
||||
static int bm3803_getstatus(struct timer_lowerhalf_s *lower,
|
||||
struct timer_status_s *status)
|
||||
{
|
||||
FAR struct bm3803_lowerhalf_s *priv =
|
||||
(FAR struct bm3803_lowerhalf_s *)lower;
|
||||
struct bm3803_lowerhalf_s *priv =
|
||||
(struct bm3803_lowerhalf_s *)lower;
|
||||
uint64_t maxtimeout;
|
||||
uint32_t timeout;
|
||||
uint32_t clock;
|
||||
@ -313,11 +313,11 @@ static int bm3803_getstatus(FAR struct timer_lowerhalf_s *lower,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int bm3803_settimeout(FAR struct timer_lowerhalf_s *lower,
|
||||
static int bm3803_settimeout(struct timer_lowerhalf_s *lower,
|
||||
uint32_t timeout)
|
||||
{
|
||||
FAR struct bm3803_lowerhalf_s *priv =
|
||||
(FAR struct bm3803_lowerhalf_s *)lower;
|
||||
struct bm3803_lowerhalf_s *priv =
|
||||
(struct bm3803_lowerhalf_s *)lower;
|
||||
uint64_t maxtimeout;
|
||||
|
||||
if (priv->started)
|
||||
@ -361,11 +361,11 @@ static int bm3803_settimeout(FAR struct timer_lowerhalf_s *lower,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void bm3803_setcallback(FAR struct timer_lowerhalf_s *lower,
|
||||
tccb_t callback, FAR void *arg)
|
||||
static void bm3803_setcallback(struct timer_lowerhalf_s *lower,
|
||||
tccb_t callback, void *arg)
|
||||
{
|
||||
FAR struct bm3803_lowerhalf_s *priv =
|
||||
(FAR struct bm3803_lowerhalf_s *)lower;
|
||||
struct bm3803_lowerhalf_s *priv =
|
||||
(struct bm3803_lowerhalf_s *)lower;
|
||||
irqstate_t flags = enter_critical_section();
|
||||
|
||||
/* Save the new callback */
|
||||
@ -407,9 +407,9 @@ static void bm3803_setcallback(FAR struct timer_lowerhalf_s *lower,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int bm3803_timer_initialize(FAR const char *devpath, int timer)
|
||||
int bm3803_timer_initialize(const char *devpath, int timer)
|
||||
{
|
||||
FAR struct bm3803_lowerhalf_s *lower;
|
||||
struct bm3803_lowerhalf_s *lower;
|
||||
|
||||
switch (timer)
|
||||
{
|
||||
@ -445,8 +445,8 @@ int bm3803_timer_initialize(FAR const char *devpath, int timer)
|
||||
* REVISIT: The returned handle is discard here.
|
||||
*/
|
||||
|
||||
FAR void *drvr = timer_register(devpath,
|
||||
(FAR struct timer_lowerhalf_s *)lower);
|
||||
void *drvr = timer_register(devpath,
|
||||
(struct timer_lowerhalf_s *)lower);
|
||||
if (drvr == NULL)
|
||||
{
|
||||
/* The actual cause of the failure may have been a failure to allocate
|
||||
|
@ -63,7 +63,7 @@ struct bm3803_lowerhalf_s
|
||||
{
|
||||
/* Lower half operations */
|
||||
|
||||
FAR const struct watchdog_ops_s *ops;
|
||||
const struct watchdog_ops_s *ops;
|
||||
uint32_t timeout; /* The (actual) selected timeout */
|
||||
uint32_t lastreset; /* The last reset time */
|
||||
bool started; /* true: The watchdog timer has been started */
|
||||
@ -80,16 +80,16 @@ struct bm3803_lowerhalf_s
|
||||
# define bm3803_getreg(addr) getreg32(addr)
|
||||
# define bm3803_putreg(val,addr) putreg32(val,addr)
|
||||
|
||||
static inline void bm3803_setreload(FAR struct bm3803_lowerhalf_s *priv);
|
||||
static inline void bm3803_setreload(struct bm3803_lowerhalf_s *priv);
|
||||
|
||||
/* "Lower half" driver methods **********************************************/
|
||||
|
||||
static int bm3803_start(FAR struct watchdog_lowerhalf_s *lower);
|
||||
static int bm3803_stop(FAR struct watchdog_lowerhalf_s *lower);
|
||||
static int bm3803_keepalive(FAR struct watchdog_lowerhalf_s *lower);
|
||||
static int bm3803_getstatus(FAR struct watchdog_lowerhalf_s *lower,
|
||||
FAR struct watchdog_status_s *status);
|
||||
static int bm3803_settimeout(FAR struct watchdog_lowerhalf_s *lower,
|
||||
static int bm3803_start(struct watchdog_lowerhalf_s *lower);
|
||||
static int bm3803_stop(struct watchdog_lowerhalf_s *lower);
|
||||
static int bm3803_keepalive(struct watchdog_lowerhalf_s *lower);
|
||||
static int bm3803_getstatus(struct watchdog_lowerhalf_s *lower,
|
||||
struct watchdog_status_s *status);
|
||||
static int bm3803_settimeout(struct watchdog_lowerhalf_s *lower,
|
||||
uint32_t timeout);
|
||||
|
||||
/****************************************************************************
|
||||
@ -129,7 +129,7 @@ static struct bm3803_lowerhalf_s g_wdgdev;
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void bm3803_setreload(FAR struct bm3803_lowerhalf_s *priv)
|
||||
static inline void bm3803_setreload(struct bm3803_lowerhalf_s *priv)
|
||||
{
|
||||
/* Set the reload value */
|
||||
|
||||
@ -151,10 +151,10 @@ static inline void bm3803_setreload(FAR struct bm3803_lowerhalf_s *priv)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int bm3803_start(FAR struct watchdog_lowerhalf_s *lower)
|
||||
static int bm3803_start(struct watchdog_lowerhalf_s *lower)
|
||||
{
|
||||
FAR struct bm3803_lowerhalf_s *priv =
|
||||
(FAR struct bm3803_lowerhalf_s *)lower;
|
||||
struct bm3803_lowerhalf_s *priv =
|
||||
(struct bm3803_lowerhalf_s *)lower;
|
||||
irqstate_t flags;
|
||||
uint32_t val = bm3803_getreg(BM3803_TIM1_BASE + BM3803_TIM_CR_OFFSET);
|
||||
val |= TIMER_WDG;
|
||||
@ -202,7 +202,7 @@ static int bm3803_start(FAR struct watchdog_lowerhalf_s *lower)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int bm3803_stop(FAR struct watchdog_lowerhalf_s *lower)
|
||||
static int bm3803_stop(struct watchdog_lowerhalf_s *lower)
|
||||
{
|
||||
uint32_t val = bm3803_getreg(BM3803_TIM1_BASE + BM3803_TIM_CR_OFFSET);
|
||||
|
||||
@ -232,10 +232,10 @@ static int bm3803_stop(FAR struct watchdog_lowerhalf_s *lower)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int bm3803_keepalive(FAR struct watchdog_lowerhalf_s *lower)
|
||||
static int bm3803_keepalive(struct watchdog_lowerhalf_s *lower)
|
||||
{
|
||||
FAR struct bm3803_lowerhalf_s *priv =
|
||||
(FAR struct bm3803_lowerhalf_s *)lower;
|
||||
struct bm3803_lowerhalf_s *priv =
|
||||
(struct bm3803_lowerhalf_s *)lower;
|
||||
irqstate_t flags;
|
||||
|
||||
wdinfo("Entry\n");
|
||||
@ -266,11 +266,11 @@ static int bm3803_keepalive(FAR struct watchdog_lowerhalf_s *lower)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int bm3803_getstatus(FAR struct watchdog_lowerhalf_s *lower,
|
||||
FAR struct watchdog_status_s *status)
|
||||
static int bm3803_getstatus(struct watchdog_lowerhalf_s *lower,
|
||||
struct watchdog_status_s *status)
|
||||
{
|
||||
FAR struct bm3803_lowerhalf_s *priv =
|
||||
(FAR struct bm3803_lowerhalf_s *)lower;
|
||||
struct bm3803_lowerhalf_s *priv =
|
||||
(struct bm3803_lowerhalf_s *)lower;
|
||||
uint32_t ticks;
|
||||
uint32_t elapsed;
|
||||
|
||||
@ -326,11 +326,11 @@ static int bm3803_getstatus(FAR struct watchdog_lowerhalf_s *lower,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int bm3803_settimeout(FAR struct watchdog_lowerhalf_s *lower,
|
||||
static int bm3803_settimeout(struct watchdog_lowerhalf_s *lower,
|
||||
uint32_t timeout)
|
||||
{
|
||||
FAR struct bm3803_lowerhalf_s *priv =
|
||||
(FAR struct bm3803_lowerhalf_s *)lower;
|
||||
struct bm3803_lowerhalf_s *priv =
|
||||
(struct bm3803_lowerhalf_s *)lower;
|
||||
uint32_t reload;
|
||||
uint16_t prescaler;
|
||||
uint32_t freqin;
|
||||
@ -402,9 +402,9 @@ static int bm3803_settimeout(FAR struct watchdog_lowerhalf_s *lower,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void bm3803_wdginitialize(FAR const char *devpath)
|
||||
void bm3803_wdginitialize(const char *devpath)
|
||||
{
|
||||
FAR struct bm3803_lowerhalf_s *priv = &g_wdgdev;
|
||||
struct bm3803_lowerhalf_s *priv = &g_wdgdev;
|
||||
|
||||
wdinfo("Entry: devpath=%s \n", devpath);
|
||||
|
||||
@ -422,12 +422,12 @@ void bm3803_wdginitialize(FAR const char *devpath)
|
||||
* device option bits, the watchdog is automatically enabled at power-on.
|
||||
*/
|
||||
|
||||
bm3803_settimeout((FAR struct watchdog_lowerhalf_s *)priv,
|
||||
bm3803_settimeout((struct watchdog_lowerhalf_s *)priv,
|
||||
CONFIG_BM3803_WDG_DEFTIMOUT);
|
||||
|
||||
/* Register the watchdog driver as /dev/watchdog0 */
|
||||
|
||||
(void)watchdog_register(devpath, (FAR struct watchdog_lowerhalf_s *)priv);
|
||||
(void)watchdog_register(devpath, (struct watchdog_lowerhalf_s *)priv);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_WATCHDOG && CONFIG_BM3803_WDG */
|
||||
|
@ -65,7 +65,7 @@ extern "C"
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_BM3803_WDG
|
||||
void bm3803_wdginitialize(FAR const char *devpath);
|
||||
void bm3803_wdginitialize(const char *devpath);
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
|
@ -78,7 +78,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int bm3823_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
||||
static int bm3823_timerisr(int irq, uint32_t *regs, void *arg)
|
||||
{
|
||||
/* Clear the pending timer interrupt */
|
||||
|
||||
|
@ -64,8 +64,8 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
|
||||
void up_allocate_heap(void **heap_start, size_t *heap_size)
|
||||
{
|
||||
*heap_start = (FAR void *)g_idle_topstack;
|
||||
*heap_start = (void *)g_idle_topstack;
|
||||
*heap_size = CONFIG_RAM_END - g_idle_topstack;
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ static void _up_assert(int errorcode)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ARCH_USBDUMP
|
||||
static int usbtrace_syslog(FAR const char *fmt, ...)
|
||||
static int usbtrace_syslog(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
@ -113,7 +113,7 @@ static int usbtrace_syslog(FAR const char *fmt, ...)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
|
||||
static int assert_tracecallback(struct usbtrace_s *trace, void *arg)
|
||||
{
|
||||
usbtrace_trprintf(usbtrace_syslog, trace->event, trace->value);
|
||||
return 0;
|
||||
|
@ -60,11 +60,11 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static size_t do_stackcheck(FAR void *stackbase, size_t nbytes)
|
||||
static size_t do_stackcheck(void *stackbase, size_t nbytes)
|
||||
{
|
||||
uintptr_t start;
|
||||
uintptr_t end;
|
||||
FAR uint32_t *ptr;
|
||||
uint32_t *ptr;
|
||||
size_t mark;
|
||||
|
||||
if (nbytes == 0)
|
||||
@ -87,7 +87,7 @@ static size_t do_stackcheck(FAR void *stackbase, size_t nbytes)
|
||||
* that does not have the magic value is the high water mark.
|
||||
*/
|
||||
|
||||
for (ptr = (FAR uint32_t *)start, mark = (nbytes >> 2);
|
||||
for (ptr = (uint32_t *)start, mark = (nbytes >> 2);
|
||||
*ptr == STACK_COLOR && mark > 0;
|
||||
ptr++, mark--);
|
||||
|
||||
@ -107,7 +107,7 @@ static size_t do_stackcheck(FAR void *stackbase, size_t nbytes)
|
||||
int i;
|
||||
int j;
|
||||
|
||||
ptr = (FAR uint32_t *)start;
|
||||
ptr = (uint32_t *)start;
|
||||
for (i = 0; i < size; i += 4 * 64)
|
||||
{
|
||||
for (j = 0; j < 64; j++)
|
||||
@ -147,7 +147,7 @@ static size_t do_stackcheck(FAR void *stackbase, size_t nbytes)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_stack_color(FAR void *stackbase, size_t nbytes)
|
||||
void up_stack_color(void *stackbase, size_t nbytes)
|
||||
{
|
||||
uint32_t *stkptr;
|
||||
uintptr_t stkend;
|
||||
@ -198,12 +198,12 @@ void up_stack_color(FAR void *stackbase, size_t nbytes)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
size_t up_check_tcbstack(FAR struct tcb_s *tcb)
|
||||
size_t up_check_tcbstack(struct tcb_s *tcb)
|
||||
{
|
||||
return do_stackcheck(tcb->stack_base_ptr, tcb->adj_stack_size);
|
||||
}
|
||||
|
||||
ssize_t up_check_tcbstack_remain(FAR struct tcb_s *tcb)
|
||||
ssize_t up_check_tcbstack_remain(struct tcb_s *tcb)
|
||||
{
|
||||
return tcb->adj_stack_size - up_check_tcbstack(tcb);
|
||||
}
|
||||
|
@ -77,7 +77,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||
int up_create_stack(struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||
{
|
||||
/* Is there already a stack allocated of a different size? Because of
|
||||
* alignment issues, stack_size might erroneously appear to be of a
|
||||
|
@ -63,11 +63,11 @@
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DUMP_ON_EXIT
|
||||
static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
|
||||
static void _up_dumponexit(struct tcb_s *tcb, void *arg)
|
||||
{
|
||||
FAR struct filelist *filelist;
|
||||
struct filelist *filelist;
|
||||
#if CONFIG_NFILE_STREAMS > 0
|
||||
FAR struct streamlist *streamlist;
|
||||
struct streamlist *streamlist;
|
||||
#endif
|
||||
int i;
|
||||
|
||||
|
@ -206,11 +206,11 @@ void up_dumpstate(void);
|
||||
|
||||
/* Software interrupt 0 handler */
|
||||
|
||||
int up_swint0(int irq, FAR void *context, FAR void *arg);
|
||||
int up_swint0(int irq, void *context, void *arg);
|
||||
|
||||
/* Software interrupt 1 handler */
|
||||
|
||||
int up_swint1(int irq, FAR void *context, FAR void *arg);
|
||||
int up_swint1(int irq, void *context, void *arg);
|
||||
|
||||
/* Signals */
|
||||
|
||||
@ -265,7 +265,7 @@ void up_usbuninitialize(void);
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
void up_stack_color(FAR void *stackbase, size_t nbytes);
|
||||
void up_stack_color(void *stackbase, size_t nbytes);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
@ -75,7 +75,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_release_stack(FAR struct tcb_s *dtcb, uint8_t ttype)
|
||||
void up_release_stack(struct tcb_s *dtcb, uint8_t ttype)
|
||||
{
|
||||
/* Is there a stack allocated? */
|
||||
|
||||
|
@ -69,9 +69,9 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
|
||||
void *up_stack_frame(struct tcb_s *tcb, size_t frame_size)
|
||||
{
|
||||
FAR void *ret;
|
||||
void *ret;
|
||||
|
||||
/* Align the frame_size */
|
||||
|
||||
@ -89,7 +89,7 @@ FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
|
||||
|
||||
/* Save the adjusted stack values in the struct tcb_s */
|
||||
|
||||
tcb->stack_base_ptr = (FAR uint8_t *)tcb->stack_base_ptr + frame_size;
|
||||
tcb->stack_base_ptr = (uint8_t *)tcb->stack_base_ptr + frame_size;
|
||||
tcb->adj_stack_size -= frame_size;
|
||||
|
||||
/* And return the pointer to the allocated region */
|
||||
|
@ -84,7 +84,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
char up_romgetc(FAR const char *ptr)
|
||||
char up_romgetc(const char *ptr)
|
||||
{
|
||||
return pgm_read_byte_near(ptr);
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ static void dispatch_syscall(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_swint1(int irq, FAR void *context, FAR void *arg)
|
||||
int up_swint1(int irq, void *context, void *arg)
|
||||
{
|
||||
uint32_t *regs = (uint32_t *)context;
|
||||
|
||||
@ -187,7 +187,7 @@ int up_swint1(int irq, FAR void *context, FAR void *arg)
|
||||
default:
|
||||
{
|
||||
#ifdef CONFIG_BUILD_KERNEL
|
||||
FAR struct tcb_s *rtcb = sched_self();
|
||||
struct tcb_s *rtcb = sched_self();
|
||||
int index = rtcb->xcp.nsyscalls;
|
||||
|
||||
/* Verify that the SYS call number is within range */
|
||||
|
@ -81,9 +81,9 @@ int bm3803_am29lv_initialize(int minor)
|
||||
{
|
||||
int ret;
|
||||
#ifdef HAVE_AM29LV
|
||||
FAR struct mtd_dev_s *mtd;
|
||||
struct mtd_dev_s *mtd;
|
||||
#if defined(CONFIG_MTD_PARTITION_NAMES)
|
||||
FAR const char *partname = CONFIG_XX3803_FLASH_PART_NAMES;
|
||||
const char *partname = CONFIG_XX3803_FLASH_PART_NAMES;
|
||||
#endif
|
||||
|
||||
/* Now bind the SPI interface to the W25 SPI FLASH driver */
|
||||
|
@ -51,7 +51,7 @@
|
||||
|
||||
static int wdog_daemon(int argc, char *argv[])
|
||||
{
|
||||
FAR struct file filestruct;
|
||||
struct file filestruct;
|
||||
int ret;
|
||||
|
||||
/* Open watchdog device */
|
||||
@ -108,7 +108,7 @@ exit_close_dev:
|
||||
|
||||
int xx3803_watchdog_initialize(void)
|
||||
{
|
||||
FAR struct file filestruct;
|
||||
struct file filestruct;
|
||||
int ret = 0;
|
||||
|
||||
/* Open the watchdog device */
|
||||
@ -149,7 +149,7 @@ int xx3803_watchdog_initialize(void)
|
||||
int taskid = kthread_create(CONFIG_XX3803_WDG_THREAD_NAME,
|
||||
CONFIG_XX3803_WDG_THREAD_PRIORITY,
|
||||
CONFIG_XX3803_WDG_THREAD_STACKSIZE,
|
||||
(main_t)wdog_daemon, (FAR char * const *)NULL);
|
||||
(main_t)wdog_daemon, (char * const *)NULL);
|
||||
|
||||
DEBUGASSERT(taskid > 0);
|
||||
UNUSED(taskid);
|
||||
|
@ -81,10 +81,10 @@ int bm3823_am29lv_initialize(int minor)
|
||||
{
|
||||
int ret;
|
||||
#ifdef HAVE_AM29LV
|
||||
FAR struct mtd_dev_s *mtd;
|
||||
FAR struct mtd_geometry_s geo;
|
||||
struct mtd_dev_s *mtd;
|
||||
struct mtd_geometry_s geo;
|
||||
#if defined(CONFIG_MTD_PARTITION_NAMES)
|
||||
FAR const char *partname = CONFIG_XX3823_FLASH_PART_NAMES;
|
||||
const char *partname = CONFIG_XX3823_FLASH_PART_NAMES;
|
||||
#endif
|
||||
|
||||
/* Now bind the SPI interface to the W25 SPI FLASH driver */
|
||||
|
Loading…
Reference in New Issue
Block a user