File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -73,9 +73,11 @@ uint8_t ria816_reg_read(ria816_t* c, uint8_t addr) {
7373 switch (addr ) {
7474 // multiplication accelerator
7575 case RIA816_MATH_MULAB :
76- case RIA816_MATH_MULAB + 1 : {
77- uint16_t mul = RIA816_REG16 (c -> reg , RIA816_MATH_OPERA ) * RIA816_REG16 (c -> reg , RIA816_MATH_OPERB );
78- data = (addr == RIA816_MATH_MULAB ) ? (mul & 0xFF ) : (mul >> 8 );
76+ case RIA816_MATH_MULAB + 1 :
77+ case RIA816_MATH_MULAB + 2 :
78+ case RIA816_MATH_MULAB + 3 : {
79+ uint32_t mul = RIA816_REG16 (c -> reg , RIA816_MATH_OPERA ) * RIA816_REG16 (c -> reg , RIA816_MATH_OPERB );
80+ data = ((uint8_t * )& mul )[addr & 0x03 ];
7981 } break ;
8082 // division accelerator
8183 case RIA816_MATH_DIVAB :
Original file line number Diff line number Diff line change @@ -128,8 +128,8 @@ extern "C" {
128128#define RIA816_MATH_OPERA (0x00) // Operand A for multiplication and division.
129129#define RIA816_MATH_OPERB (0x02) // Operand B for multiplication and division.
130130#define RIA816_MATH_MULAB (0x04) // OPERA * OPERB.
131- #define RIA816_MATH_DIVAB (0x06 ) // Signed OPERA / unsigned OPERB.
132- #define RIA816_TIME_TM (0x08 ) // Time Of Day (ms) - 48bits (6 bytes)
131+ #define RIA816_MATH_DIVAB (0x08 ) // Signed OPERA / unsigned OPERB.
132+ #define RIA816_TIME_TM (0x0A ) // Time Of Day (ms) - 48bits (6 bytes)
133133#define RIA816_DMA_ADDRSRC (0x10) // DMA source address.
134134#define RIA816_DMA_STEPSRC (0x13) // DMA source step.
135135#define RIA816_DMA_ADDRDST (0x14) // DMA destination address.
You can’t perform that action at this time.
0 commit comments