news: Add LED support
This commit is contained in:
parent
6d577b33b7
commit
b7188acd4f
6 changed files with 82 additions and 35 deletions
|
|
@ -52,11 +52,11 @@ static uint8_t rbuf[RBUF_SIZE];
|
|||
static uint8_t rbuf_head = 0;
|
||||
static uint8_t rbuf_tail = 0;
|
||||
|
||||
uint8_t news_recv(void)
|
||||
int16_t news_recv(void)
|
||||
{
|
||||
uint8_t data = 0;
|
||||
if (rbuf_head == rbuf_tail) {
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
data = rbuf[rbuf_tail];
|
||||
|
|
@ -74,6 +74,12 @@ ISR(NEWS_KBD_RX_VECT)
|
|||
}
|
||||
}
|
||||
|
||||
void news_send(uint8_t data)
|
||||
{
|
||||
while (!SERIAL_UART_TXD_READY) ;
|
||||
SERIAL_UART_DATA = data;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
SONY NEWS Keyboard Protocol
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
/* host role */
|
||||
void news_init(void);
|
||||
uint8_t news_recv(void);
|
||||
int16_t news_recv(void);
|
||||
void news_send(uint8_t data);
|
||||
|
||||
/* device role */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue