theandrew168 / derzforth

Bare-metal Forth implementation for RISC-V
MIT License
42 stars 5 forks source link

Forgot a _BIT ? #18

Closed agsb closed 2 years ago

agsb commented 2 years ago

Hi,

Thanks for that Forth, is a reference for riscv boards.

There is no file file GD32VF103.asm in sources, then I get one from github, but usart control bits have a sufix _BIT, as

USART_STAT_RBNE_BIT = 5 USART_STAT_TBE_BIT = 7

in file https://github.com/theandrew168/derzforth/blob/main/boards/gd32_dev_board/board.asm, there is no suffix, then maybe could changed for

line 98, andi t1, t1, USART_STAT_RBNE # isolate read buffer not empty (RBNE) bit to line 98, andi t1, t1, USART_STAT_RBNE_BIT # isolate read buffer not empty (RBNE) bit

line 112, andi t1, t1, USART_STAT_TBE # isolate transmit buffer empty (TBE) bit to line 112, andi t1, t1, USART_STAT_TBE_BIT # isolate transmit buffer empty (TBE) bit

Thanks.

Alvaro

agsb commented 2 years ago

Forget it! The file GD32VF103.asm is at bronzebeard sources, and have the correct shifts !!! I'm using a gcc-complex-riscv-generic-compiler-not-smart, to adapt your usart0 code sorry; Thanks