mirror of
https://github.com/Fishwaldo/bl_mcu_sdk.git
synced 2025-07-23 05:08:45 +00:00
[update] update lhal, soc and demos
* Add flash driver and init in boards. * Add timeout for all poll wait apis * Add 808 d0 startup to bringup * Update lhal device tables * Update demos
This commit is contained in:
parent
9f241971e3
commit
d6fab307bf
232 changed files with 26802 additions and 1471 deletions
|
@ -2,33 +2,33 @@
|
|||
#include "bflb_uart.h"
|
||||
#include "board.h"
|
||||
|
||||
struct bflb_device_s *uart1;
|
||||
struct bflb_device_s *uartx;
|
||||
|
||||
static uint8_t uart_txbuf[128] = {0};
|
||||
|
||||
void uart_isr(int irq, void *arg)
|
||||
{
|
||||
uint32_t intstatus = bflb_uart_get_intstatus(uart1);
|
||||
uint32_t intstatus = bflb_uart_get_intstatus(uartx);
|
||||
|
||||
if (intstatus & UART_INTSTS_RX_FIFO) {
|
||||
while (bflb_uart_rxavailable(uart1)) {
|
||||
while (bflb_uart_rxavailable(uartx)) {
|
||||
printf("enter rx fifo interrupt");
|
||||
printf("0x%02x\r\n", bflb_uart_getchar(uart1));
|
||||
printf("0x%02x\r\n", bflb_uart_getchar(uartx));
|
||||
}
|
||||
}
|
||||
if (intstatus & UART_INTSTS_RTO) {
|
||||
while (bflb_uart_rxavailable(uart1)) {
|
||||
bflb_uart_int_clear(uartx, UART_INTCLR_RTO);
|
||||
while (bflb_uart_rxavailable(uartx)) {
|
||||
printf("enter rto interrupt");
|
||||
printf("0x%02x\r\n", bflb_uart_getchar(uart1));
|
||||
printf("0x%02x\r\n", bflb_uart_getchar(uartx));
|
||||
}
|
||||
bflb_uart_int_clear(uart1, UART_INTCLR_RTO);
|
||||
}
|
||||
if (intstatus & UART_INTSTS_TX_FIFO) {
|
||||
for (uint8_t i = 0; i < 27; i++)
|
||||
{
|
||||
bflb_uart_putchar(uart1,uart_txbuf[i]);
|
||||
bflb_uart_putchar(uartx,uart_txbuf[i]);
|
||||
}
|
||||
bflb_uart_txint_mask(uart1, true);
|
||||
bflb_uart_txint_mask(uartx, true);
|
||||
printf("tx interrupt end");
|
||||
}
|
||||
}
|
||||
|
@ -36,9 +36,9 @@ void uart_isr(int irq, void *arg)
|
|||
int main(void)
|
||||
{
|
||||
board_init();
|
||||
board_uart1_gpio_init();
|
||||
board_uartx_gpio_init();
|
||||
|
||||
uart1 = bflb_device_get_by_name("uart1");
|
||||
uartx = bflb_device_get_by_name("uart3");
|
||||
|
||||
for(uint8_t i=0; i < 128; i++)
|
||||
{
|
||||
|
@ -54,12 +54,12 @@ int main(void)
|
|||
cfg.flow_ctrl = 0;
|
||||
cfg.tx_fifo_threshold = 7;
|
||||
cfg.rx_fifo_threshold = 7;
|
||||
bflb_uart_init(uart1, &cfg);
|
||||
//bflb_uart_init(uartx, &cfg);
|
||||
|
||||
bflb_uart_txint_mask(uart1, false);
|
||||
bflb_uart_rxint_mask(uart1, false);
|
||||
bflb_irq_attach(uart1->irq_num, uart_isr, uart1);
|
||||
bflb_irq_enable(uart1->irq_num);
|
||||
bflb_uart_txint_mask(uartx, false);
|
||||
bflb_uart_rxint_mask(uartx, false);
|
||||
bflb_irq_attach(uartx->irq_num, uart_isr, NULL);
|
||||
bflb_irq_enable(uartx->irq_num);
|
||||
|
||||
while (1) {
|
||||
bflb_mtimer_delay_ms(2000);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue