File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,6 +144,18 @@ void DMAChannel::interpret_cmd() {
144144 }
145145}
146146
147+ void DMAChannel::update_cmd () {
148+ if (this ->cur_is_writable ) {
149+ if (this ->cur_cmd < DBDMA_Cmd::STOP )
150+ WRITE_WORD_LE_A (&this ->cur_host ->xfer_stat , this ->ch_stat | CH_STAT_ACTIVE );
151+
152+ // all INPUT and OUTPUT commands including LOAD_QUAD and STORE_QUAD update cmd.resCount
153+ if (this ->cur_cmd < DBDMA_Cmd::NOP )
154+ WRITE_WORD_LE_A (&this ->cur_host ->res_count , this ->res_count );
155+ }
156+ this ->ch_stat &= ~(CH_STAT_FLUSH | CH_STAT_BT );
157+ }
158+
147159void DMAChannel::finish_cmd () {
148160 bool branch_taken = false ;
149161
@@ -186,17 +198,9 @@ void DMAChannel::finish_cmd() {
186198 this ->ch_stat |= CH_STAT_BT ;
187199 }
188200 }
189-
190- if (this ->cur_is_writable )
191- WRITE_WORD_LE_A (&this ->cur_host ->xfer_stat , this ->ch_stat | CH_STAT_ACTIVE );
192201 }
193202
194- this ->ch_stat &= ~(CH_STAT_FLUSH | CH_STAT_BT );
195-
196- // all INPUT and OUTPUT commands including LOAD_QUAD and STORE_QUAD update cmd.resCount
197- if (this ->cur_cmd < DBDMA_Cmd::NOP && this ->cur_is_writable ) {
198- WRITE_WORD_LE_A (&this ->cur_host ->res_count , this ->res_count );
199- }
203+ this ->update_cmd ();
200204
201205 if (this ->cur_cmd < DBDMA_Cmd::STOP && !branch_taken)
202206 this ->cmd_ptr += 16 ;
Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ class DMAChannel : public DmaBidirChannel, public DmaChannel {
141141protected:
142142 DMACmd* fetch_cmd (uint32_t cmd_addr, DMACmd* p_cmd, bool *is_writable);
143143 void interpret_cmd (void );
144+ void update_cmd ();
144145 void finish_cmd ();
145146 void xfer_quad (bool is_store);
146147 void update_irq (uint8_t cmd_bits);
You can’t perform that action at this time.
0 commit comments