TProcess to slow?
BlitzMax Forums/MaxGUI Module/TProcess to slow?
| ||
I have written a nice GUI for avrdude. Now i have a problem. If i use the TProcess to start avrdude in terminal the STDOUTPUT shows me not all. AVR device initialized and ready to accept instructions Device signature = 0x1e9502 "efuse" memory type not defined for part "ATMEGA32" AVR device initialized and ready to accept instructions Device signature = 0x1e9502 reading lfuse memory: writing output file "<stdout>" ->HEX VALUE MISSING AVR device initialized and ready to accept instructions Device signature = 0x1e9502 reading hfuse memory: writing output file "<stdout>" 0xd9 done. AVR device initialized and ready to accept instructions Device signature = 0x1e9502 "ffuse" memory type not defined for part "ATMEGA32" done. Has anyone the same problem? |
| ||
Don't know the avrdude, but do you read out both TPipeStream from TProcess (error and pipe)? May post some code... |
| ||
Yes i do. Here is the Codesample: If ButtonState(erase)= True Then SetButtonState(erase,False) Process:TProcess = CreateProcess(AppDir$+"/MacAVR.app/contents/MacOS/avrdude -q -C"+avrconfig+" -c"+prog$[id]+" -p"+parta$[chip]+" -e") While Process.Status() If Process.err.ReadAvail() Or Process.pipe.ReadAvail() Then linepipe = Process.pipe.ReadLine().Trim() lineerro = Process.err.ReadLine().Trim() If linepipe <> "" Then AddTextAreaText(textarea , linepipe+Chr$(13)) EndIf If lineerro <> "" Then AddTextAreaText(textarea , lineerro+Chr$(13)) EndIf EndIf Wend EndIf If ButtonState(fusebit)=True Then SetButtonState(fusebit,False) ' read efuse fmode1="-Uefuse:r:" filename$="-" Process:TProcess = CreateProcess(AppDir$+"/MacAVR.app/contents/MacOS/avrdude -q -C"+avrconfig+" -c"+prog$[id]+" -p"+parta$[chip]+" "+fmode1+filename$+":h") While Process.Status() PollSystem() If Process.err.ReadAvail() Or Process.pipe.ReadAvail() Then linepipe = Process.pipe.ReadLine().Trim() lineerro = Process.err.ReadLine().Trim() If linepipe <> "" Then Print linepipe AddTextAreaText(textarea , linepipe+Chr$(13)) EndIf If lineerro <> "" Then Print lineerro AddTextAreaText(textarea , lineerro+Chr$(13)) EndIf EndIf Wend ' read lfuse fmode1="-Ulfuse:r:" filename$="-" Process:TProcess = CreateProcess(AppDir$+"/MacAVR.app/contents/MacOS/avrdude -q -C"+avrconfig+" -c"+prog$[id]+" -p"+parta$[chip]+" "+fmode1+filename$+":h") While Process.Status() PollSystem() If Process.err.ReadAvail() Or Process.pipe.ReadAvail() Then linepipe = Process.pipe.ReadLine().Trim() lineerro = Process.err.ReadLine().Trim() If linepipe <> "" Then Print linepipe AddTextAreaText(textarea , linepipe+Chr$(13)) EndIf If lineerro <> "" Then Print lineerro AddTextAreaText(textarea , lineerro+Chr$(13)) EndIf EndIf Wend ' read hfuse fmode1="-Uhfuse:r:" filename$="-" Process:TProcess = CreateProcess(AppDir$+"/MacAVR.app/contents/MacOS/avrdude -q -C"+avrconfig+" -c"+prog$[id]+" -p"+parta$[chip]+" "+fmode1+filename$+":h") While Process.Status() PollSystem() If Process.err.ReadAvail() Or Process.pipe.ReadAvail() Then linepipe = Process.pipe.ReadLine().Trim() lineerro = Process.err.ReadLine().Trim() If linepipe <> "" Then Print linepipe AddTextAreaText(textarea , linepipe+Chr$(13)) EndIf If lineerro <> "" Then Print lineerro AddTextAreaText(textarea , lineerro+Chr$(13)) EndIf EndIf Wend ' read ffuse fmode1="-Uffuse:r:" filename$="-" Process:TProcess = CreateProcess(AppDir$+"/MacAVR.app/contents/MacOS/avrdude -q -C"+avrconfig+" -c"+prog$[id]+" -p"+parta$[chip]+" "+fmode1+filename$+":h") While Process.Status() PollSystem() If Process.err.ReadAvail() Or Process.pipe.ReadAvail() Then linepipe = Process.pipe.ReadLine().Trim() lineerro = Process.err.ReadLine().Trim() If linepipe <> "" Then AddTextAreaText(textarea , linepipe+Chr$(13)) Print linepipe EndIf If lineerro <> "" Then AddTextAreaText(textarea , lineerro+Chr$(13)) Print lineerro EndIf EndIf Wend EndIf Any idea? |
| ||
You don't set the console output flag, that could be the problem. Instead of: Process:TProcess = CreateProcess(AppDir$+"/MacAVR.app/contents/MacOS/avrdude -q -C"+avrconfig+" -c"+prog$[id]+" -p"+parta$[chip]+" -e") try: Process:TProcess = CreateProcess(AppDir$+"/MacAVR.app/contents/MacOS/avrdude -q -C"+avrconfig+" -c"+prog$[id]+" -p"+parta$[chip]+" -e", 1 ) |
| ||
Cool AVR freaks live on these forums! |
| ||
Cool, that was the problem, thanx. Yes @ LAB, i am making Hardware with AVR Comntroller and i am working on a GUI for avrdude. I have avrdude adapted for use with Blitzmax. |