|
|
|
@ -2,7 +2,7 @@
@@ -2,7 +2,7 @@
|
|
|
|
|
* arch/mips/src/pic32mx/pic32mx-serial.c |
|
|
|
|
* |
|
|
|
|
* Copyright (C) 2011 Gregory Nutt. All rights reserved. |
|
|
|
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> |
|
|
|
|
* Author: Gregory Nutt <gnutt@nuttx.org> |
|
|
|
|
* |
|
|
|
|
* Redistribution and use in source and binary forms, with or without |
|
|
|
|
* modification, are permitted provided that the following conditions |
|
|
|
@ -160,8 +160,8 @@ struct up_dev_s
@@ -160,8 +160,8 @@ struct up_dev_s
|
|
|
|
|
|
|
|
|
|
static inline uint32_t up_serialin(struct up_dev_s *priv, int offset); |
|
|
|
|
static inline void up_serialout(struct up_dev_s *priv, int offset, uint32_t value); |
|
|
|
|
static void up_restoreuartint(struct up_dev_s *priv, uint8_t im); |
|
|
|
|
static void up_disableuartint(struct up_dev_s *priv, uint8_t *im); |
|
|
|
|
static void up_restoreuartint(struct uart_dev_s *dev, uint8_t im); |
|
|
|
|
static void up_disableuartint(struct uart_dev_s *dev, uint8_t *im); |
|
|
|
|
|
|
|
|
|
/* Serial driver methods */ |
|
|
|
|
|
|
|
|
@ -320,8 +320,9 @@ static void up_restoreuartint(struct uart_dev_s *dev, uint8_t im)
@@ -320,8 +320,9 @@ static void up_restoreuartint(struct uart_dev_s *dev, uint8_t im)
|
|
|
|
|
* Name: up_disableuartint |
|
|
|
|
****************************************************************************/ |
|
|
|
|
|
|
|
|
|
static void up_disableuartint(sstruct uart_dev_s *dev, uint8_t *im) |
|
|
|
|
static void up_disableuartint(struct uart_dev_s *dev, uint8_t *im) |
|
|
|
|
{ |
|
|
|
|
struct up_dev_s *priv = (struct up_dev_s*)dev->priv; |
|
|
|
|
irqstate_t flags; |
|
|
|
|
|
|
|
|
|
flags = irqsave(); |
|
|
|
@ -761,12 +762,12 @@ static bool up_txempty(struct uart_dev_s *dev)
@@ -761,12 +762,12 @@ static bool up_txempty(struct uart_dev_s *dev)
|
|
|
|
|
void up_earlyserialinit(void) |
|
|
|
|
{ |
|
|
|
|
/* Disable interrupts from all UARTS. The console is enabled in
|
|
|
|
|
* pic32mx_consoleinit() |
|
|
|
|
* pic32mx_consoleinit(). |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
up_disableuartint(TTYS0_DEV, NULL); |
|
|
|
|
up_disableuartint(&TTYS0_DEV, NULL); |
|
|
|
|
#ifdef TTYS1_DEV |
|
|
|
|
up_disableuartint(TTYS1_DEV, NULL); |
|
|
|
|
up_disableuartint(&TTYS1_DEV, NULL); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
/* Configuration whichever one is the console */ |
|
|
|
@ -814,7 +815,7 @@ int up_putc(int ch)
@@ -814,7 +815,7 @@ int up_putc(int ch)
|
|
|
|
|
{ |
|
|
|
|
#ifdef HAVE_SERIAL_CONSOLE |
|
|
|
|
struct uart_dev_s *dev = (struct uart_dev_s *)&CONSOLE_DEV; |
|
|
|
|
uint32_t imr; |
|
|
|
|
uint8_t imr; |
|
|
|
|
|
|
|
|
|
up_disableuartint(dev, &imr); |
|
|
|
|
|
|
|
|
|