File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ uint8_t ria816_reg_read(ria816_t* c, uint8_t addr) {
8585 const int16_t oper_a = RIA816_REG16 (c -> reg , RIA816_MATH_OPERA );
8686 const uint16_t oper_b = RIA816_REG16 (c -> reg , RIA816_MATH_OPERB );
8787 uint16_t div = oper_b ? (oper_a / oper_b ) : 0xFFFF ;
88- data = (addr == RIA816_MATH_DIVAB ) ? ( div & 0xFF ) : ( div >> 8 ) ;
88+ data = (( uint8_t * ) & div )[ addr & 0x01 ] ;
8989 } break ;
9090
9191 // Time Of Day
@@ -95,7 +95,7 @@ uint8_t ria816_reg_read(ria816_t* c, uint8_t addr) {
9595 case RIA816_TIME_TM + 3 :
9696 case RIA816_TIME_TM + 4 :
9797 case RIA816_TIME_TM + 5 : {
98- data = ((uint8_t * )& c -> us )[addr & 0x07 ];
98+ data = ((uint8_t * )& c -> us )[( addr - 2 ) & 0x07 ];
9999 } break ;
100100
101101 case RIA816_UART_READY : {
You can’t perform that action at this time.
0 commit comments