minor fixes of DMA uart code
This commit is contained in:
parent
2e1c856741
commit
5b7b3da99c
|
@ -26,7 +26,7 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)$Id: uart1.c,v 1.20 2011/01/05 12:02:02 joxe Exp $
|
* @(#)$Id: uart1.c,v 1.21 2011/01/05 13:36:38 joxe Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -58,7 +58,7 @@ static volatile uint8_t transmitting;
|
||||||
#endif /* UART1_CONF_TX_WITH_INTERRUPT */
|
#endif /* UART1_CONF_TX_WITH_INTERRUPT */
|
||||||
|
|
||||||
#ifdef UART1_CONF_RX_WITH_DMA
|
#ifdef UART1_CONF_RX_WITH_DMA
|
||||||
#define TX_WITH_INTERRUPT UART1_CONF_RX_WITH_DMA
|
#define RX_WITH_DMA UART1_CONF_RX_WITH_DMA
|
||||||
#else /* UART1_CONF_RX_WITH_DMA */
|
#else /* UART1_CONF_RX_WITH_DMA */
|
||||||
#define RX_WITH_DMA 0
|
#define RX_WITH_DMA 0
|
||||||
#endif /* UART1_CONF_RX_WITH_DMA */
|
#endif /* UART1_CONF_RX_WITH_DMA */
|
||||||
|
@ -82,7 +82,7 @@ handle_rxdma_timer(void *ptr)
|
||||||
{
|
{
|
||||||
uint8_t size;
|
uint8_t size;
|
||||||
size = DMA0SZ; /* Note: loop requires that size is less or eq to RXBUFSIZE */
|
size = DMA0SZ; /* Note: loop requires that size is less or eq to RXBUFSIZE */
|
||||||
for (;last_size != size; last_size--) {
|
for(;last_size != size; last_size--) {
|
||||||
if(last_size == 0) last_size = RXBUFSIZE;
|
if(last_size == 0) last_size = RXBUFSIZE;
|
||||||
/* printf("read: %c\n", (unsigned char)rxbuf[RXBUFSIZE - last_size]); */
|
/* printf("read: %c\n", (unsigned char)rxbuf[RXBUFSIZE - last_size]); */
|
||||||
uart1_input_handler((unsigned char)rxbuf[RXBUFSIZE - last_size]);
|
uart1_input_handler((unsigned char)rxbuf[RXBUFSIZE - last_size]);
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* This file is part of the Contiki operating system.
|
||||||
*
|
*
|
||||||
* @(#)$Id: msp430.c,v 1.14 2011/01/05 12:02:01 joxe Exp $
|
* @(#)$Id: msp430.c,v 1.15 2011/01/05 13:36:38 joxe Exp $
|
||||||
*/
|
*/
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
@ -195,7 +195,7 @@ static char *cur_break = (char *)&_end;
|
||||||
void
|
void
|
||||||
msp430_add_lpm_req(int req)
|
msp430_add_lpm_req(int req)
|
||||||
{
|
{
|
||||||
if (req <= MSP430_REQUIRE_LPM1) {
|
if(req <= MSP430_REQUIRE_LPM1) {
|
||||||
msp430_dco_required++;
|
msp430_dco_required++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ msp430_add_lpm_req(int req)
|
||||||
void
|
void
|
||||||
msp430_remove_lpm_req(int req)
|
msp430_remove_lpm_req(int req)
|
||||||
{
|
{
|
||||||
if (req <= MSP430_REQUIRE_LPM1) {
|
if(req <= MSP430_REQUIRE_LPM1) {
|
||||||
msp430_dco_required--;
|
msp430_dco_required--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* This file is part of the Contiki operating system.
|
||||||
*
|
*
|
||||||
* $Id: msp430.h,v 1.3 2011/01/05 12:02:01 joxe Exp $
|
* $Id: msp430.h,v 1.4 2011/01/05 13:36:38 joxe Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
#define MSP430_REQUIRE_LPM2 2
|
#define MSP430_REQUIRE_LPM2 2
|
||||||
#define MSP430_REQUIRE_LPM3 3
|
#define MSP430_REQUIRE_LPM3 3
|
||||||
|
|
||||||
void msp430_add_lpm_req();
|
void msp430_add_lpm_req(int req);
|
||||||
void msp430_remove_lpm_req();
|
void msp430_remove_lpm_req(int req);
|
||||||
|
|
||||||
#endif /* __MSP430_H__ */
|
#endif /* __MSP430_H__ */
|
||||||
|
|
Loading…
Reference in a new issue