mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-02-06 04:30:00 +00:00
dbdma: implement xfer_to_device method.
This commit is contained in:
parent
46425faaa9
commit
5057792d4d
@ -97,6 +97,7 @@ uint8_t DMAChannel::interpret_cmd() {
|
||||
switch (this->cur_cmd) {
|
||||
case DBDMA_Cmd::OUTPUT_MORE:
|
||||
case DBDMA_Cmd::OUTPUT_LAST:
|
||||
this->xfer_to_device();
|
||||
if (this->out_cb)
|
||||
this->out_cb();
|
||||
break;
|
||||
@ -434,6 +435,20 @@ void DMAChannel::xfer_from_device() {
|
||||
this->interpret_cmd();
|
||||
}
|
||||
|
||||
void DMAChannel::xfer_to_device() {
|
||||
if (this->dev_obj == nullptr)
|
||||
return;
|
||||
|
||||
this->xfer_dir = DMA_DIR_TO_DEV;
|
||||
|
||||
if (!this->dev_obj->xfer_to(this->queue_data, this->queue_len)) {
|
||||
this->queue_len = 0;
|
||||
this->finish_cmd();
|
||||
}
|
||||
|
||||
this->interpret_cmd();
|
||||
}
|
||||
|
||||
DmaPullResult DMAChannel::pull_data(uint32_t req_len, uint32_t *avail_len, uint8_t **p_data)
|
||||
{
|
||||
*avail_len = 0;
|
||||
|
@ -135,6 +135,7 @@ protected:
|
||||
void xfer_quad(const DMACmd *cmd_desc, DMACmd *cmd_host);
|
||||
void update_irq();
|
||||
void xfer_from_device();
|
||||
void xfer_to_device();
|
||||
|
||||
void start(void);
|
||||
void resume(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user