@@ -161,12 +161,12 @@ void DMAChannel::finish_cmd() {
161161 // perform actions under control of "i" interrupt, "b" branch, and "w" wait bits
162162 if (this ->cur_cmd < DBDMA_Cmd::STOP) {
163163 // react to cmd.w (wait) bits
164- if (cmd_desc[ 2 ] & 3 ) {
164+ if (saved_cmd_bits & 3 ) {
165165 bool cond = true ;
166- if ((cmd_desc[ 2 ] & 3 ) != 3 ) {
166+ if ((saved_cmd_bits & 3 ) != 3 ) {
167167 uint16_t wt_mask = this ->wait_select >> 16 ;
168168 cond = (this ->ch_stat & wt_mask) == (this ->wait_select & wt_mask);
169- if ((cmd_desc[ 2 ] & 3 ) == 2 ) {
169+ if ((saved_cmd_bits & 3 ) == 2 ) {
170170 cond = !cond; // wait if cond = false
171171 }
172172 }
@@ -178,12 +178,12 @@ void DMAChannel::finish_cmd() {
178178 this ->ch_stat &= ~CH_STAT_BT;
179179
180180 // react to cmd.b (branch) bits
181- if (cmd_desc[ 2 ] & 0xC ) {
181+ if (saved_cmd_bits & 0xC ) {
182182 bool cond = true ;
183- if ((cmd_desc[ 2 ] & 0xC ) != 0xC ) {
183+ if ((saved_cmd_bits & 0xC ) != 0xC ) {
184184 uint16_t br_mask = this ->branch_select >> 16 ;
185185 cond = (this ->ch_stat & br_mask) == (this ->branch_select & br_mask);
186- if ((cmd_desc[ 2 ] & 0xC ) == 0x8 ) {
186+ if ((saved_cmd_bits & 0xC ) == 0x8 ) {
187187 cond = !cond; // branch if cond = false
188188 }
189189 }
0 commit comments