mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 16:59:28 +08:00
AVR: Fix some spacing issues
This commit is contained in:
@@ -110,7 +110,7 @@ static inline void up_enableosc32(void)
|
|||||||
|
|
||||||
regval = getreg32(AVR32_PM_OSCCTRL32);
|
regval = getreg32(AVR32_PM_OSCCTRL32);
|
||||||
regval &= ~PM_OSCCTRL32_STARTUP_MASK;
|
regval &= ~PM_OSCCTRL32_STARTUP_MASK;
|
||||||
regval |= PM_OSCCTRL32_EN|(AVR32_OSC32STARTUP << PM_OSCCTRL32_STARTUP_SHIFT);
|
regval |= PM_OSCCTRL32_EN | (AVR32_OSC32STARTUP << PM_OSCCTRL32_STARTUP_SHIFT);
|
||||||
putreg32(regval, AVR32_PM_OSCCTRL32);
|
putreg32(regval, AVR32_PM_OSCCTRL32);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ static void usart_setbaudrate(uintptr_t usart_base, uint32_t baudrate)
|
|||||||
{
|
{
|
||||||
/* Select 16x oversampling mode and clear the SYNC mode bit */
|
/* Select 16x oversampling mode and clear the SYNC mode bit */
|
||||||
|
|
||||||
mr &= ~(USART_MR_OVER|USART_MR_SYNC);
|
mr &= ~(USART_MR_OVER | USART_MR_SYNC);
|
||||||
|
|
||||||
/* Calculate the clock divider assuming 16x oversampling */
|
/* Calculate the clock divider assuming 16x oversampling */
|
||||||
|
|
||||||
@@ -218,8 +218,9 @@ void usart_reset(uintptr_t usart_base)
|
|||||||
/* Disable RX and TX, put USART in reset, disable handshaking signals */
|
/* Disable RX and TX, put USART in reset, disable handshaking signals */
|
||||||
|
|
||||||
usart_putreg(usart_base, AVR32_USART_CR_OFFSET,
|
usart_putreg(usart_base, AVR32_USART_CR_OFFSET,
|
||||||
USART_CR_RSTRX|USART_CR_RSTTX|USART_CR_RSTSTA|USART_CR_RSTIT|
|
USART_CR_RSTRX | USART_CR_RSTTX | USART_CR_RSTSTA |
|
||||||
USART_CR_RSTNACK|USART_CR_DTRDIS|USART_CR_RTSDIS);
|
USART_CR_RSTIT | USART_CR_RSTNACK | USART_CR_DTRDIS |
|
||||||
|
USART_CR_RTSDIS);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -243,7 +244,7 @@ void usart_configure(uintptr_t usart_base, uint32_t baud, unsigned int parity,
|
|||||||
|
|
||||||
/* Configure STOP bits */
|
/* Configure STOP bits */
|
||||||
|
|
||||||
regval = USART_MR_MODE_NORMAL|USART_MR_CHMODE_NORMAL; /* Normal RS-232 mode */
|
regval = USART_MR_MODE_NORMAL | USART_MR_CHMODE_NORMAL; /* Normal RS-232 mode */
|
||||||
regval |= stop2 ? USART_MR_NBSTOP_2 : USART_MR_NBSTOP_1;
|
regval |= stop2 ? USART_MR_NBSTOP_2 : USART_MR_NBSTOP_1;
|
||||||
|
|
||||||
/* Configure parity */
|
/* Configure parity */
|
||||||
@@ -285,7 +286,7 @@ void usart_configure(uintptr_t usart_base, uint32_t baud, unsigned int parity,
|
|||||||
/* Enable RX and TX */
|
/* Enable RX and TX */
|
||||||
|
|
||||||
regval = usart_getreg(usart_base, AVR32_USART_CR_OFFSET);
|
regval = usart_getreg(usart_base, AVR32_USART_CR_OFFSET);
|
||||||
regval |= (USART_CR_RXEN|USART_CR_TXEN);
|
regval |= (USART_CR_RXEN | USART_CR_TXEN);
|
||||||
usart_putreg(usart_base, AVR32_USART_CR_OFFSET, regval);
|
usart_putreg(usart_base, AVR32_USART_CR_OFFSET, regval);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -354,7 +355,7 @@ void up_consoleinit(void)
|
|||||||
/* Enable selected clocks (and disabled unselected clocks) */
|
/* Enable selected clocks (and disabled unselected clocks) */
|
||||||
|
|
||||||
regval = getreg32(AVR32_PM_PBAMASK);
|
regval = getreg32(AVR32_PM_PBAMASK);
|
||||||
regval &= ~(PM_PBAMASK_USART0|PM_PBAMASK_USART1|PM_PBAMASK_USART2);
|
regval &= ~(PM_PBAMASK_USART0 | PM_PBAMASK_USART1 | PM_PBAMASK_USART2);
|
||||||
regval |= pbamask;
|
regval |= pbamask;
|
||||||
putreg32(regval, AVR32_PM_PBAMASK);
|
putreg32(regval, AVR32_PM_PBAMASK);
|
||||||
|
|
||||||
|
|||||||
@@ -358,7 +358,7 @@ static inline void up_disableusartint(struct up_dev_s *priv, uint32_t *imr)
|
|||||||
static int up_setup(struct uart_dev_s *dev)
|
static int up_setup(struct uart_dev_s *dev)
|
||||||
{
|
{
|
||||||
#ifndef CONFIG_SUPPRESS_UART_CONFIG
|
#ifndef CONFIG_SUPPRESS_UART_CONFIG
|
||||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||||
|
|
||||||
/* Configure the USART as an RS-232 UART */
|
/* Configure the USART as an RS-232 UART */
|
||||||
|
|
||||||
@@ -380,7 +380,7 @@ static int up_setup(struct uart_dev_s *dev)
|
|||||||
|
|
||||||
static void up_shutdown(struct uart_dev_s *dev)
|
static void up_shutdown(struct uart_dev_s *dev)
|
||||||
{
|
{
|
||||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||||
|
|
||||||
/* Reset, disable interrupts, and disable Rx and Tx */
|
/* Reset, disable interrupts, and disable Rx and Tx */
|
||||||
|
|
||||||
@@ -404,7 +404,7 @@ static void up_shutdown(struct uart_dev_s *dev)
|
|||||||
|
|
||||||
static int up_attach(struct uart_dev_s *dev)
|
static int up_attach(struct uart_dev_s *dev)
|
||||||
{
|
{
|
||||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||||
|
|
||||||
/* Attach the IRQ */
|
/* Attach the IRQ */
|
||||||
|
|
||||||
@@ -423,7 +423,7 @@ static int up_attach(struct uart_dev_s *dev)
|
|||||||
|
|
||||||
static void up_detach(struct uart_dev_s *dev)
|
static void up_detach(struct uart_dev_s *dev)
|
||||||
{
|
{
|
||||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||||
up_serialout(priv, AVR32_USART_IDR_OFFSET, 0xffffffff);
|
up_serialout(priv, AVR32_USART_IDR_OFFSET, 0xffffffff);
|
||||||
irq_detach(priv->irq);
|
irq_detach(priv->irq);
|
||||||
}
|
}
|
||||||
@@ -472,7 +472,7 @@ static int up_interrupt(int irq, void *context)
|
|||||||
{
|
{
|
||||||
PANIC();
|
PANIC();
|
||||||
}
|
}
|
||||||
priv = (struct up_dev_s*)dev->priv;
|
priv = (struct up_dev_s *)dev->priv;
|
||||||
DEBUGASSERT(priv);
|
DEBUGASSERT(priv);
|
||||||
|
|
||||||
/* Loop until there are no characters to be transferred or,
|
/* Loop until there are no characters to be transferred or,
|
||||||
@@ -491,7 +491,7 @@ static int up_interrupt(int irq, void *context)
|
|||||||
|
|
||||||
/* Handle incoming, receive bytes (with or without timeout) */
|
/* Handle incoming, receive bytes (with or without timeout) */
|
||||||
|
|
||||||
if ((csr & (USART_CSR_RXRDY|USART_CSR_TIMEOUT)) != 0)
|
if ((csr & (USART_CSR_RXRDY | USART_CSR_TIMEOUT)) != 0)
|
||||||
{
|
{
|
||||||
/* Received data ready... process incoming bytes */
|
/* Received data ready... process incoming bytes */
|
||||||
|
|
||||||
@@ -509,6 +509,7 @@ static int up_interrupt(int irq, void *context)
|
|||||||
handled = true;
|
handled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -533,7 +534,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
|||||||
dev = inode->i_private;
|
dev = inode->i_private;
|
||||||
|
|
||||||
DEBUGASSERT(dev, dev->priv);
|
DEBUGASSERT(dev, dev->priv);
|
||||||
priv = (struct up_dev_s*)dev->priv;
|
priv = (struct up_dev_s *)dev->priv;
|
||||||
|
|
||||||
switch (cmd)
|
switch (cmd)
|
||||||
{
|
{
|
||||||
@@ -563,7 +564,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
|||||||
|
|
||||||
static int up_receive(struct uart_dev_s *dev, uint32_t *status)
|
static int up_receive(struct uart_dev_s *dev, uint32_t *status)
|
||||||
{
|
{
|
||||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||||
uint32_t rhr;
|
uint32_t rhr;
|
||||||
|
|
||||||
/* Get the Rx byte. The USART Rx interrupt flag is cleared by side effect
|
/* Get the Rx byte. The USART Rx interrupt flag is cleared by side effect
|
||||||
@@ -595,7 +596,7 @@ static int up_receive(struct uart_dev_s *dev, uint32_t *status)
|
|||||||
|
|
||||||
static void up_rxint(struct uart_dev_s *dev, bool enable)
|
static void up_rxint(struct uart_dev_s *dev, bool enable)
|
||||||
{
|
{
|
||||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||||
|
|
||||||
if (enable)
|
if (enable)
|
||||||
{
|
{
|
||||||
@@ -606,19 +607,19 @@ static void up_rxint(struct uart_dev_s *dev, bool enable)
|
|||||||
#ifndef CONFIG_SUPPRESS_SERIAL_INTS
|
#ifndef CONFIG_SUPPRESS_SERIAL_INTS
|
||||||
# ifdef CONFIG_USART_ERRINTS
|
# ifdef CONFIG_USART_ERRINTS
|
||||||
up_serialout(priv, AVR32_USART_IER_OFFSET,
|
up_serialout(priv, AVR32_USART_IER_OFFSET,
|
||||||
USART_INT_RXRDY|USART_INT_TIMEOUT|
|
USART_INT_RXRDY | USART_INT_TIMEOUT | USART_INT_OVRE |
|
||||||
USART_INT_OVRE|USART_INT_FRAME|USART_INT_PARE);
|
USART_INT_FRAME | USART_INT_PARE);
|
||||||
# else
|
# else
|
||||||
up_serialout(priv, AVR32_USART_IER_OFFSET,
|
up_serialout(priv, AVR32_USART_IER_OFFSET,
|
||||||
USART_INT_RXRDY|USART_INT_TIMEOUT);
|
USART_INT_RXRDY | USART_INT_TIMEOUT);
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
up_serialout(priv, AVR32_USART_IDR_OFFSET,
|
up_serialout(priv, AVR32_USART_IDR_OFFSET,
|
||||||
USART_INT_RXRDY|USART_INT_TIMEOUT|
|
USART_INT_RXRDY | USART_INT_TIMEOUT | USART_INT_OVRE |
|
||||||
USART_INT_OVRE|USART_INT_FRAME|USART_INT_PARE);
|
USART_INT_FRAME | USART_INT_PARE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -632,7 +633,7 @@ static void up_rxint(struct uart_dev_s *dev, bool enable)
|
|||||||
|
|
||||||
static bool up_rxavailable(struct uart_dev_s *dev)
|
static bool up_rxavailable(struct uart_dev_s *dev)
|
||||||
{
|
{
|
||||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
/* Read the channel status register and check if character is available to
|
/* Read the channel status register and check if character is available to
|
||||||
@@ -653,7 +654,7 @@ static bool up_rxavailable(struct uart_dev_s *dev)
|
|||||||
|
|
||||||
static void up_send(struct uart_dev_s *dev, int ch)
|
static void up_send(struct uart_dev_s *dev, int ch)
|
||||||
{
|
{
|
||||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||||
up_serialout(priv, AVR32_USART_THR_OFFSET, (uint32_t)ch);
|
up_serialout(priv, AVR32_USART_THR_OFFSET, (uint32_t)ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -667,7 +668,7 @@ static void up_send(struct uart_dev_s *dev, int ch)
|
|||||||
|
|
||||||
static void up_txint(struct uart_dev_s *dev, bool enable)
|
static void up_txint(struct uart_dev_s *dev, bool enable)
|
||||||
{
|
{
|
||||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
|
|
||||||
flags = irqsave();
|
flags = irqsave();
|
||||||
@@ -704,7 +705,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable)
|
|||||||
|
|
||||||
static bool up_txready(struct uart_dev_s *dev)
|
static bool up_txready(struct uart_dev_s *dev)
|
||||||
{
|
{
|
||||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
/* Read the channel status register and check if THR is ready to accept
|
/* Read the channel status register and check if THR is ready to accept
|
||||||
@@ -790,7 +791,7 @@ void up_serialinit(void)
|
|||||||
int up_putc(int ch)
|
int up_putc(int ch)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SERIAL_CONSOLE
|
#ifdef HAVE_SERIAL_CONSOLE
|
||||||
struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv;
|
struct up_dev_s *priv = (struct up_dev_s *)CONSOLE_DEV.priv;
|
||||||
uint32_t imr;
|
uint32_t imr;
|
||||||
|
|
||||||
up_disableusartint(priv, &imr);
|
up_disableusartint(priv, &imr);
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ static int usart1_attach(struct uart_dev_s *dev)
|
|||||||
|
|
||||||
(void)irq_attach(AT90USB_IRQ_U1RX, usart1_rxinterrupt);
|
(void)irq_attach(AT90USB_IRQ_U1RX, usart1_rxinterrupt);
|
||||||
(void)irq_attach(AT90USB_IRQ_U1DRE, usart1_txinterrupt);
|
(void)irq_attach(AT90USB_IRQ_U1DRE, usart1_txinterrupt);
|
||||||
// (void)irq_attach(AT90USB_IRQ_U1TX, usart1_txinterrupt);
|
//(void)irq_attach(AT90USB_IRQ_U1TX, usart1_txinterrupt);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -271,7 +271,7 @@ static void usart1_detach(struct uart_dev_s *dev)
|
|||||||
|
|
||||||
(void)irq_detach(AT90USB_IRQ_U1RX);
|
(void)irq_detach(AT90USB_IRQ_U1RX);
|
||||||
(void)irq_detach(AT90USB_IRQ_U1DRE);
|
(void)irq_detach(AT90USB_IRQ_U1DRE);
|
||||||
// (void)irq_detach(AT90USB_IRQ_U1TX);
|
//(void)irq_detach(AT90USB_IRQ_U1TX);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -92,8 +92,7 @@
|
|||||||
# error "Cannot represent this timer frequency"
|
# error "Cannot represent this timer frequency"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/* Eg. CPU_CLOCK = 8MHz, CLOCKS_PER_SEC = 100
|
||||||
* Eg. CPU_CLOCK = 8MHz, CLOCKS_PER_SEC = 100
|
|
||||||
*
|
*
|
||||||
* MATCH1 ((8000000 + 50) / 100) = 80,000 FREQ=100.0Hz
|
* MATCH1 ((8000000 + 50) / 100) = 80,000 FREQ=100.0Hz
|
||||||
* MATCH8 ((1000000 + 50) / 100) = 10,000 FREQ=100.0Hz <-- this one
|
* MATCH8 ((1000000 + 50) / 100) = 10,000 FREQ=100.0Hz <-- this one
|
||||||
|
|||||||
@@ -450,7 +450,7 @@ static int avr_fifoready(int timeout)
|
|||||||
{
|
{
|
||||||
UDINT &= ~(1 << SOFI);
|
UDINT &= ~(1 << SOFI);
|
||||||
|
|
||||||
for (;;)
|
for (; ; )
|
||||||
{
|
{
|
||||||
/* Check if the FIFO is ready by testing RWAL (read/write allowed). The
|
/* Check if the FIFO is ready by testing RWAL (read/write allowed). The
|
||||||
* meaning of this bigtdepends on the direction of the endpoint: For an
|
* meaning of this bigtdepends on the direction of the endpoint: For an
|
||||||
@@ -1386,7 +1386,7 @@ static inline void avr_ep0setup(void)
|
|||||||
|
|
||||||
/* Read EP0 setup data -- Read the setup data from the hardware. */
|
/* Read EP0 setup data -- Read the setup data from the hardware. */
|
||||||
|
|
||||||
ptr = (uint8_t*)&ctrl;
|
ptr = (uint8_t *)&ctrl;
|
||||||
for (i = 0; i < USB_SIZEOF_CTRLREQ; i++)
|
for (i = 0; i < USB_SIZEOF_CTRLREQ; i++)
|
||||||
{
|
{
|
||||||
*ptr++ = UEDATX;
|
*ptr++ = UEDATX;
|
||||||
|
|||||||
@@ -387,7 +387,7 @@ static int usart0_attach(struct uart_dev_s *dev)
|
|||||||
|
|
||||||
(void)irq_attach(ATMEGA_IRQ_U0RX, usart0_rxinterrupt);
|
(void)irq_attach(ATMEGA_IRQ_U0RX, usart0_rxinterrupt);
|
||||||
(void)irq_attach(ATMEGA_IRQ_U0DRE, usart0_txinterrupt);
|
(void)irq_attach(ATMEGA_IRQ_U0DRE, usart0_txinterrupt);
|
||||||
// (void)irq_attach(ATMEGA_IRQ_U0TX, usart0_txinterrupt);
|
//(void)irq_attach(ATMEGA_IRQ_U0TX, usart0_txinterrupt);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -409,7 +409,7 @@ static int usart1_attach(struct uart_dev_s *dev)
|
|||||||
|
|
||||||
(void)irq_attach(ATMEGA_IRQ_U1RX, usart1_rxinterrupt);
|
(void)irq_attach(ATMEGA_IRQ_U1RX, usart1_rxinterrupt);
|
||||||
(void)irq_attach(ATMEGA_IRQ_U1DRE, usart1_txinterrupt);
|
(void)irq_attach(ATMEGA_IRQ_U1DRE, usart1_txinterrupt);
|
||||||
// (void)irq_attach(ATMEGA_IRQ_U1TX, usart1_txinterrupt);
|
//(void)irq_attach(ATMEGA_IRQ_U1TX, usart1_txinterrupt);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -450,7 +450,7 @@ static void usart1_detach(struct uart_dev_s *dev)
|
|||||||
|
|
||||||
(void)irq_detach(ATMEGA_IRQ_U1RX);
|
(void)irq_detach(ATMEGA_IRQ_U1RX);
|
||||||
(void)irq_detach(ATMEGA_IRQ_U1DRE);
|
(void)irq_detach(ATMEGA_IRQ_U1DRE);
|
||||||
// (void)irq_detach(ATMEGA_IRQ_U1TX);
|
//(void)irq_detach(ATMEGA_IRQ_U1TX);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -92,8 +92,7 @@
|
|||||||
# error "Cannot represent this timer frequency"
|
# error "Cannot represent this timer frequency"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/* Eg. CPU_CLOCK = 8MHz, CLOCKS_PER_SEC = 100
|
||||||
* Eg. CPU_CLOCK = 8MHz, CLOCKS_PER_SEC = 100
|
|
||||||
*
|
*
|
||||||
* MATCH1 ((8000000 + 50) / 100) = 80,000 FREQ=100.0Hz
|
* MATCH1 ((8000000 + 50) / 100) = 80,000 FREQ=100.0Hz
|
||||||
* MATCH8 ((1000000 + 50) / 100) = 10,000 FREQ=100.0Hz <-- this one
|
* MATCH8 ((1000000 + 50) / 100) = 10,000 FREQ=100.0Hz <-- this one
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
void up_block_task(struct tcb_s *tcb, tstate_t task_state)
|
void up_block_task(struct tcb_s *tcb, tstate_t task_state)
|
||||||
{
|
{
|
||||||
struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head;
|
||||||
bool switch_needed;
|
bool switch_needed;
|
||||||
|
|
||||||
/* Verify that the context switch can be performed */
|
/* Verify that the context switch can be performed */
|
||||||
@@ -127,7 +127,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
|
|||||||
* of the g_readytorun task list.
|
* of the g_readytorun task list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s *)g_readytorun.head;
|
||||||
|
|
||||||
/* Reset scheduler parameters */
|
/* Reset scheduler parameters */
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head;
|
||||||
|
|
||||||
/* Reset scheduler parameters */
|
/* Reset scheduler parameters */
|
||||||
|
|
||||||
|
|||||||
@@ -175,12 +175,12 @@ ssize_t up_check_tcbstack_remain(FAR struct tcb_s *tcb)
|
|||||||
|
|
||||||
size_t up_check_stack(void)
|
size_t up_check_stack(void)
|
||||||
{
|
{
|
||||||
return up_check_tcbstack((FAR struct tcb_s*)g_readytorun.head);
|
return up_check_tcbstack((FAR struct tcb_s *)g_readytorun.head);
|
||||||
}
|
}
|
||||||
|
|
||||||
ssize_t up_check_stack_remain(void)
|
ssize_t up_check_stack_remain(void)
|
||||||
{
|
{
|
||||||
return up_check_tcbstack_remain((FAR struct tcb_s*)g_readytorun.head);
|
return up_check_tcbstack_remain((FAR struct tcb_s *)g_readytorun.head);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
|
|||||||
@@ -90,12 +90,12 @@ uint8_t *up_doirq(uint8_t irq, uint8_t *regs)
|
|||||||
* current_regs is also used to manage interrupt level context switches.
|
* current_regs is also used to manage interrupt level context switches.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
savestate = (uint8_t*)current_regs; /* Cast removes volatile attribute */
|
savestate = (uint8_t *)current_regs; /* Cast removes volatile attribute */
|
||||||
current_regs = regs;
|
current_regs = regs;
|
||||||
|
|
||||||
/* Deliver the IRQ */
|
/* Deliver the IRQ */
|
||||||
|
|
||||||
irq_dispatch((int)irq, (uint32_t*)regs);
|
irq_dispatch((int)irq, (uint32_t *)regs);
|
||||||
|
|
||||||
/* If a context switch occurred while processing the interrupt then
|
/* If a context switch occurred while processing the interrupt then
|
||||||
* current_regs may have change value. If we return any value different
|
* current_regs may have change value. If we return any value different
|
||||||
@@ -103,7 +103,7 @@ uint8_t *up_doirq(uint8_t irq, uint8_t *regs)
|
|||||||
* switch occurred during interrupt processing.
|
* switch occurred during interrupt processing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
regs = (uint8_t*)current_regs; /* Cast removes volatile attribute */
|
regs = (uint8_t *)current_regs; /* Cast removes volatile attribute */
|
||||||
|
|
||||||
/* Restore the previous value of current_regs. NULL would indicate that
|
/* Restore the previous value of current_regs. NULL would indicate that
|
||||||
* we are no longer in an interrupt handler. It will be non-NULL if we
|
* we are no longer in an interrupt handler. It will be non-NULL if we
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ static void up_stackdump(uint16_t sp, uint16_t stack_base)
|
|||||||
|
|
||||||
for (stack = sp & ~3; stack < stack_base; stack += 12)
|
for (stack = sp & ~3; stack < stack_base; stack += 12)
|
||||||
{
|
{
|
||||||
uint8_t *ptr = (uint8_t*)stack;
|
uint8_t *ptr = (uint8_t *)stack;
|
||||||
lldbg("%04x: %02x %02x %02x %02x %02x %02x %02x %02x"
|
lldbg("%04x: %02x %02x %02x %02x %02x %02x %02x %02x"
|
||||||
" %02x %02x %02x %02x\n",
|
" %02x %02x %02x %02x\n",
|
||||||
stack,
|
stack,
|
||||||
@@ -168,7 +168,7 @@ static inline void up_registerdump(void)
|
|||||||
|
|
||||||
void up_dumpstate(void)
|
void up_dumpstate(void)
|
||||||
{
|
{
|
||||||
struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head;
|
||||||
uint16_t sp = up_getsp();
|
uint16_t sp = up_getsp();
|
||||||
uint16_t ustackbase;
|
uint16_t ustackbase;
|
||||||
uint16_t ustacksize;
|
uint16_t ustacksize;
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
void up_release_pending(void)
|
void up_release_pending(void)
|
||||||
{
|
{
|
||||||
struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head;
|
||||||
|
|
||||||
slldbg("From TCB=%p\n", rtcb);
|
slldbg("From TCB=%p\n", rtcb);
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ void up_release_pending(void)
|
|||||||
* of the g_readytorun task list.
|
* of the g_readytorun task list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s *)g_readytorun.head;
|
||||||
|
|
||||||
/* Update scheduler parameters */
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ void up_release_pending(void)
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head;
|
||||||
|
|
||||||
/* Update scheduler parameters */
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head;
|
||||||
bool switch_needed;
|
bool switch_needed;
|
||||||
|
|
||||||
slldbg("TCB=%p PRI=%d\n", tcb, priority);
|
slldbg("TCB=%p PRI=%d\n", tcb, priority);
|
||||||
@@ -149,7 +149,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
|
|||||||
* of the g_readytorun task list.
|
* of the g_readytorun task list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s *)g_readytorun.head;
|
||||||
|
|
||||||
/* Update scheduler parameters */
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head;
|
||||||
|
|
||||||
/* Update scheduler parameters */
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs);
|
sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs);
|
||||||
|
|
||||||
if (tcb == (struct tcb_s*)g_readytorun.head)
|
if (tcb == (struct tcb_s *)g_readytorun.head)
|
||||||
{
|
{
|
||||||
/* CASE 1: We are not in an interrupt handler and
|
/* CASE 1: We are not in an interrupt handler and
|
||||||
* a task is signalling itself for some reason.
|
* a task is signalling itself for some reason.
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
|
|
||||||
void up_sigdeliver(void)
|
void up_sigdeliver(void)
|
||||||
{
|
{
|
||||||
struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head;
|
||||||
uint8_t regs[XCPTCONTEXT_REGS];
|
uint8_t regs[XCPTCONTEXT_REGS];
|
||||||
sig_deliver_t sigdeliver;
|
sig_deliver_t sigdeliver;
|
||||||
|
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency)
|
|||||||
}
|
}
|
||||||
else /* if (frequency >= BOARD_CPU_CLOCK / 128) */
|
else /* if (frequency >= BOARD_CPU_CLOCK / 128) */
|
||||||
{
|
{
|
||||||
spcr |= (1 << SPR0)|(1 << SPR1);
|
spcr |= (1 << SPR0) | (1 << SPR1);
|
||||||
actual = BOARD_CPU_CLOCK / 128;
|
actual = BOARD_CPU_CLOCK / 128;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -393,7 +393,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd)
|
|||||||
|
|
||||||
/* Wait for transmission to complete */
|
/* Wait for transmission to complete */
|
||||||
|
|
||||||
while (!(SPSR & (1<<SPIF)));
|
while (!(SPSR & (1 << SPIF)));
|
||||||
|
|
||||||
/* Then return the received value */
|
/* Then return the received value */
|
||||||
|
|
||||||
@@ -422,7 +422,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd)
|
|||||||
|
|
||||||
static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size_t nwords)
|
static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size_t nwords)
|
||||||
{
|
{
|
||||||
FAR uint8_t *ptr = (FAR uint8_t*)buffer;
|
FAR uint8_t *ptr = (FAR uint8_t *)buffer;
|
||||||
|
|
||||||
spidbg("nwords: %d\n", nwords);
|
spidbg("nwords: %d\n", nwords);
|
||||||
while (nwords-- > 0)
|
while (nwords-- > 0)
|
||||||
@@ -453,7 +453,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size
|
|||||||
|
|
||||||
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nwords)
|
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nwords)
|
||||||
{
|
{
|
||||||
FAR uint8_t *ptr = (FAR uint8_t*)buffer;
|
FAR uint8_t *ptr = (FAR uint8_t *)buffer;
|
||||||
|
|
||||||
spidbg("nwords: %d\n", nwords);
|
spidbg("nwords: %d\n", nwords);
|
||||||
while (nwords-- > 0)
|
while (nwords-- > 0)
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
|
|
||||||
void up_unblock_task(struct tcb_s *tcb)
|
void up_unblock_task(struct tcb_s *tcb)
|
||||||
{
|
{
|
||||||
struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head;
|
||||||
|
|
||||||
/* Verify that the context switch can be performed */
|
/* Verify that the context switch can be performed */
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ void up_unblock_task(struct tcb_s *tcb)
|
|||||||
* of the g_readytorun task list.
|
* of the g_readytorun task list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s *)g_readytorun.head;
|
||||||
|
|
||||||
/* Update scheduler parameters */
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ void up_unblock_task(struct tcb_s *tcb)
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head;
|
||||||
|
|
||||||
/* Update scheduler parameters */
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
|
|
||||||
void up_block_task(struct tcb_s *tcb, tstate_t task_state)
|
void up_block_task(struct tcb_s *tcb, tstate_t task_state)
|
||||||
{
|
{
|
||||||
struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head;
|
||||||
bool switch_needed;
|
bool switch_needed;
|
||||||
|
|
||||||
/* Verify that the context switch can be performed */
|
/* Verify that the context switch can be performed */
|
||||||
@@ -128,7 +128,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
|
|||||||
* of the g_readytorun task list.
|
* of the g_readytorun task list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s *)g_readytorun.head;
|
||||||
|
|
||||||
/* Reset scheduler parameters */
|
/* Reset scheduler parameters */
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
|
|||||||
* run list.
|
* run list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head;
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_ADDRENV
|
#ifdef CONFIG_ARCH_ADDRENV
|
||||||
/* Make sure that the address environment for the previously
|
/* Make sure that the address environment for the previously
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ uint32_t *up_doirq(int irq, uint32_t *regs)
|
|||||||
#ifdef CONFIG_ARCH_FPU
|
#ifdef CONFIG_ARCH_FPU
|
||||||
/* Restore floating point registers */
|
/* Restore floating point registers */
|
||||||
|
|
||||||
up_restorefpu((uint32_t*)current_regs);
|
up_restorefpu((uint32_t *)current_regs);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_ADDRENV
|
#ifdef CONFIG_ARCH_ADDRENV
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
|||||||
|
|
||||||
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
|
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
|
||||||
{
|
{
|
||||||
uint32_t *ptr = (uint32_t*)stack;
|
uint32_t *ptr = (uint32_t *)stack;
|
||||||
lldbg("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
lldbg("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||||
stack, ptr[0], ptr[1], ptr[2], ptr[3],
|
stack, ptr[0], ptr[1], ptr[2], ptr[3],
|
||||||
ptr[4], ptr[5], ptr[6], ptr[7]);
|
ptr[4], ptr[5], ptr[6], ptr[7]);
|
||||||
@@ -145,7 +145,7 @@ static inline void up_registerdump(void)
|
|||||||
|
|
||||||
void up_dumpstate(void)
|
void up_dumpstate(void)
|
||||||
{
|
{
|
||||||
struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head;
|
||||||
uint32_t sp = up_getsp();
|
uint32_t sp = up_getsp();
|
||||||
uint32_t ustackbase;
|
uint32_t ustackbase;
|
||||||
uint32_t ustacksize;
|
uint32_t ustacksize;
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
|
|
||||||
void up_release_pending(void)
|
void up_release_pending(void)
|
||||||
{
|
{
|
||||||
struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head;
|
||||||
|
|
||||||
slldbg("From TCB=%p\n", rtcb);
|
slldbg("From TCB=%p\n", rtcb);
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ void up_release_pending(void)
|
|||||||
* of the g_readytorun task list.
|
* of the g_readytorun task list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s *)g_readytorun.head;
|
||||||
|
|
||||||
/* Update scheduler parameters */
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ void up_release_pending(void)
|
|||||||
* ready to run list.
|
* ready to run list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head;
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_ADDRENV
|
#ifdef CONFIG_ARCH_ADDRENV
|
||||||
/* Make sure that the address environment for the previously
|
/* Make sure that the address environment for the previously
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head;
|
||||||
bool switch_needed;
|
bool switch_needed;
|
||||||
|
|
||||||
slldbg("TCB=%p PRI=%d\n", tcb, priority);
|
slldbg("TCB=%p PRI=%d\n", tcb, priority);
|
||||||
@@ -150,7 +150,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
|
|||||||
* of the g_readytorun task list.
|
* of the g_readytorun task list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s *)g_readytorun.head;
|
||||||
|
|
||||||
/* Update scheduler parameters */
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
|
|||||||
* ready to run list.
|
* ready to run list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head;
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_ADDRENV
|
#ifdef CONFIG_ARCH_ADDRENV
|
||||||
/* Make sure that the address environment for the previously
|
/* Make sure that the address environment for the previously
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs);
|
sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs);
|
||||||
|
|
||||||
if (tcb == (struct tcb_s*)g_readytorun.head)
|
if (tcb == (struct tcb_s *)g_readytorun.head)
|
||||||
{
|
{
|
||||||
/* CASE 1: We are not in an interrupt handler and
|
/* CASE 1: We are not in an interrupt handler and
|
||||||
* a task is signalling itself for some reason.
|
* a task is signalling itself for some reason.
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
|
|
||||||
void up_sigdeliver(void)
|
void up_sigdeliver(void)
|
||||||
{
|
{
|
||||||
struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head;
|
||||||
#if 0
|
#if 0
|
||||||
uint32_t regs[XCPTCONTEXT_REGS+3]; /* Why +3? See below */
|
uint32_t regs[XCPTCONTEXT_REGS+3]; /* Why +3? See below */
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
|
|
||||||
void up_unblock_task(struct tcb_s *tcb)
|
void up_unblock_task(struct tcb_s *tcb)
|
||||||
{
|
{
|
||||||
struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head;
|
||||||
|
|
||||||
/* Verify that the context switch can be performed */
|
/* Verify that the context switch can be performed */
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ void up_unblock_task(struct tcb_s *tcb)
|
|||||||
* of the g_readytorun task list.
|
* of the g_readytorun task list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s *)g_readytorun.head;
|
||||||
|
|
||||||
/* Update scheduler parameters */
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ void up_unblock_task(struct tcb_s *tcb)
|
|||||||
* g_readytorun task list.
|
* g_readytorun task list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *nexttcb = (struct tcb_s *)g_readytorun.head;
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_ADDRENV
|
#ifdef CONFIG_ARCH_ADDRENV
|
||||||
/* Make sure that the address environment for the previously
|
/* Make sure that the address environment for the previously
|
||||||
|
|||||||
@@ -83,6 +83,6 @@
|
|||||||
void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
|
void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
|
||||||
{
|
{
|
||||||
board_led_on(LED_HEAPALLOCATE);
|
board_led_on(LED_HEAPALLOCATE);
|
||||||
*heap_start = (FAR void*)g_idle_topstack;
|
*heap_start = (FAR void *)g_idle_topstack;
|
||||||
*heap_size = CONFIG_RAM_END - g_idle_topstack;
|
*heap_size = CONFIG_RAM_END - g_idle_topstack;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,10 +105,10 @@ static void _up_assert(int errorcode)
|
|||||||
{
|
{
|
||||||
/* Are we in an interrupt handler or the idle task? */
|
/* Are we in an interrupt handler or the idle task? */
|
||||||
|
|
||||||
if (current_regs || ((struct tcb_s*)g_readytorun.head)->pid == 0)
|
if (current_regs || ((struct tcb_s *)g_readytorun.head)->pid == 0)
|
||||||
{
|
{
|
||||||
(void)irqsave();
|
(void)irqsave();
|
||||||
for (;;)
|
for (; ; )
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_ARCH_LEDS
|
#ifdef CONFIG_ARCH_LEDS
|
||||||
board_led_on(LED_PANIC);
|
board_led_on(LED_PANIC);
|
||||||
@@ -160,7 +160,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
|
|||||||
void up_assert(const uint8_t *filename, int lineno)
|
void up_assert(const uint8_t *filename, int lineno)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_PRINT_TASKNAME
|
#ifdef CONFIG_PRINT_TASKNAME
|
||||||
struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
board_led_on(LED_ASSERTION);
|
board_led_on(LED_ASSERTION);
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
|
|||||||
|
|
||||||
void _exit(int status)
|
void _exit(int status)
|
||||||
{
|
{
|
||||||
struct tcb_s* tcb;
|
struct tcb_s *tcb;
|
||||||
|
|
||||||
/* Disable interrupts. They will be restored when the next
|
/* Disable interrupts. They will be restored when the next
|
||||||
* task is started.
|
* task is started.
|
||||||
@@ -161,7 +161,7 @@ void _exit(int status)
|
|||||||
* head of the list.
|
* head of the list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
tcb = (struct tcb_s*)g_readytorun.head;
|
tcb = (struct tcb_s *)g_readytorun.head;
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_ADDRENV
|
#ifdef CONFIG_ARCH_ADDRENV
|
||||||
/* Make sure that the address environment for the previously running
|
/* Make sure that the address environment for the previously running
|
||||||
|
|||||||
Reference in New Issue
Block a user