forked from len0rd/rockbox
hwstub: fix atj213x dsp lua code
Change-Id: I5fbd1799b958bedbe74f91bdcdd8a544e15d2a78
This commit is contained in:
parent
f47f04b65f
commit
ad5e5c42fb
1 changed files with 9 additions and 9 deletions
|
|
@ -37,21 +37,21 @@ end
|
||||||
-- specified number of miliseconds before stoping DSP
|
-- specified number of miliseconds before stoping DSP
|
||||||
-- Then you can inspect DSP memories from MIPS side
|
-- Then you can inspect DSP memories from MIPS side
|
||||||
function ATJ.dsp.run(msec)
|
function ATJ.dsp.run(msec)
|
||||||
DSP.stop()
|
ATJ.dsp.stop()
|
||||||
DSP.start()
|
ATJ.dsp.start()
|
||||||
hwstub.mdelay(msec)
|
hwstub.mdelay(msec)
|
||||||
DSP.stop()
|
ATJ.dsp.stop()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Clear DSP program memory
|
-- Clear DSP program memory
|
||||||
function ATJ.dsp.clearPM()
|
function ATJ.dsp.clearPM()
|
||||||
DSP.stop()
|
ATJ.dsp.stop()
|
||||||
for i=0,16*1024-1,4 do DEV.write32(0xb4040000+i, 0) end
|
for i=0,16*1024-1,4 do DEV.write32(0xb4040000+i, 0) end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Clear DSP data memory
|
-- Clear DSP data memory
|
||||||
function ATJ.dsp.clearDM()
|
function ATJ.dsp.clearDM()
|
||||||
DSP.stop()
|
ATJ.dsp.stop()
|
||||||
for i=0,16*1024-1,4 do DEV.write32(0xb4050000+i, 0) end
|
for i=0,16*1024-1,4 do DEV.write32(0xb4050000+i, 0) end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -83,9 +83,9 @@ function ATJ.dsp.prog(opcodes, base, type)
|
||||||
end
|
end
|
||||||
|
|
||||||
local offset=0
|
local offset=0
|
||||||
DSP.stop()
|
ATJ.dsp.stop()
|
||||||
for i,opcode in ipairs(opcodes) do
|
for i,opcode in ipairs(opcodes) do
|
||||||
DSP.write(base+4*offset, opcode)
|
ATJ.dsp.write(base+4*offset, opcode)
|
||||||
offset=offset+1
|
offset=offset+1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -112,7 +112,7 @@ function ATJ.dsp.progfile(path)
|
||||||
-- Search for header describing target memory
|
-- Search for header describing target memory
|
||||||
if string.find(line, '@PA') ~= nil then
|
if string.find(line, '@PA') ~= nil then
|
||||||
type = 'p'
|
type = 'p'
|
||||||
elseif string.find(line, '@PD' ~= nil) then
|
elseif string.find(line, '@PD') ~= nil then
|
||||||
type = 'd'
|
type = 'd'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -148,7 +148,7 @@ function ATJ.dsp.progfile(path)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Write to DSP memory
|
-- Write to DSP memory
|
||||||
DSP.prog(opcodes, addr, type)
|
ATJ.dsp.prog(opcodes, addr, type)
|
||||||
opcodes={}
|
opcodes={}
|
||||||
addr = nil
|
addr = nil
|
||||||
type = nil
|
type = nil
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue