Skip to content

Commit

Permalink
hwstub: fix atj213x dsp lua code
Browse files Browse the repository at this point in the history
Change-Id: I5fbd1799b958bedbe74f91bdcdd8a544e15d2a78
  • Loading branch information
wodz committed Nov 17, 2015
1 parent f47f04b commit ad5e5c4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions utils/hwstub/tools/lua/atj/dsp.lua
Expand Up @@ -37,21 +37,21 @@ end
-- specified number of miliseconds before stoping DSP
-- Then you can inspect DSP memories from MIPS side
function ATJ.dsp.run(msec)
DSP.stop()
DSP.start()
ATJ.dsp.stop()
ATJ.dsp.start()
hwstub.mdelay(msec)
DSP.stop()
ATJ.dsp.stop()
end

-- Clear DSP program memory
function ATJ.dsp.clearPM()
DSP.stop()
ATJ.dsp.stop()
for i=0,16*1024-1,4 do DEV.write32(0xb4040000+i, 0) end
end

-- Clear DSP data memory
function ATJ.dsp.clearDM()
DSP.stop()
ATJ.dsp.stop()
for i=0,16*1024-1,4 do DEV.write32(0xb4050000+i, 0) end
end

Expand Down Expand Up @@ -83,9 +83,9 @@ function ATJ.dsp.prog(opcodes, base, type)
end

local offset=0
DSP.stop()
ATJ.dsp.stop()
for i,opcode in ipairs(opcodes) do
DSP.write(base+4*offset, opcode)
ATJ.dsp.write(base+4*offset, opcode)
offset=offset+1
end
end
Expand All @@ -112,7 +112,7 @@ function ATJ.dsp.progfile(path)
-- Search for header describing target memory
if string.find(line, '@PA') ~= nil then
type = 'p'
elseif string.find(line, '@PD' ~= nil) then
elseif string.find(line, '@PD') ~= nil then
type = 'd'
end

Expand Down Expand Up @@ -148,7 +148,7 @@ function ATJ.dsp.progfile(path)
end

-- Write to DSP memory
DSP.prog(opcodes, addr, type)
ATJ.dsp.prog(opcodes, addr, type)
opcodes={}
addr = nil
type = nil
Expand Down

0 comments on commit ad5e5c4

Please sign in to comment.