apply oldPRCR to board_init()
This commit is contained in:
@@ -249,9 +249,10 @@ void board_init(void)
|
||||
EN(SCI5, TEI5) = 1;
|
||||
|
||||
/* Enable USB0 */
|
||||
unsigned short oldPRCR = SYSTEM.PRCR.WORD;
|
||||
SYSTEM.PRCR.WORD = SYSTEM_PRCR_PRKEY | SYSTEM_PRCR_PRC1;
|
||||
MSTP(USB0) = 0;
|
||||
SYSTEM.PRCR.WORD = SYSTEM_PRCR_PRKEY;
|
||||
SYSTEM.PRCR.WORD = SYSTEM_PRCR_PRKEY | oldPRCR;
|
||||
|
||||
/* setup USBI0 interrupt. */
|
||||
IR(USB0, USBI0) = 0;
|
||||
@@ -277,6 +278,7 @@ int board_uart_read(uint8_t* buf, int len)
|
||||
sci_buf[1].buf = buf;
|
||||
sci_buf[1].cnt = len;
|
||||
SCI5.SCR.BYTE |= SCI_SCR_RE | SCI_SCR_RIE;
|
||||
// TODO change to non blocking, return -1 immediately if no data
|
||||
while (SCI5.SCR.BIT.RE) ;
|
||||
return len - sci_buf[1].cnt;
|
||||
}
|
||||
|
Reference in New Issue
Block a user