Click here to Skip to main content
15,887,135 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Dear all, I kindly ask for your help , please Pin
Graeme_Grant30-Sep-23 7:15
mvaGraeme_Grant30-Sep-23 7:15 
GeneralRe: Dear all, I kindly ask for your help , please Pin
OriginalGriff30-Sep-23 6:16
mveOriginalGriff30-Sep-23 6:16 
GeneralRe: Dear all, I kindly ask for your help , please Pin
Mike Hankey30-Sep-23 6:23
mveMike Hankey30-Sep-23 6:23 
GeneralRe: Dear all, I kindly ask for your help , please Pin
peterkmx1-Oct-23 0:53
professionalpeterkmx1-Oct-23 0:53 
GeneralRe: Dear all, I kindly ask for your help , please Pin
mngerhold1-Oct-23 22:43
mngerhold1-Oct-23 22:43 
PraiseRe: Dear all, I kindly ask for your help , please Pin
0x01AA2-Oct-23 0:56
mve0x01AA2-Oct-23 0:56 
GeneralRe: Dear all, I kindly ask for your help , please Pin
Jeremy Falcon2-Oct-23 1:47
professionalJeremy Falcon2-Oct-23 1:47 
GeneralSo this is fun: a war story Pin
honey the codewitch30-Sep-23 0:58
mvahoney the codewitch30-Sep-23 0:58 
Update: I rebooted and now everything works fine. Laugh | :laugh: Laugh | :laugh: Laugh | :laugh: Dead | X|

I'm kind of rubber ducking you all, so bear with me (or skip) and thanks.

It's the wee hours here. I don't know what I changed in my code, but one minute it was working.

The next minute every time I start it it's like the procedure that builds all the windows exits halfway through without creating everything, and then the app doesn't exit. (It appears to, but you have to kill it in TaskMan)

I should pack it in but that leaves me for want of something to do (I woke up recently), and code in a known bad state.

All of this mess is to simply read and write serial ports in win32, but due to a sort of polarity mismatch between the Arduino and Win32 APIs I need to spin a thread to continually fetch data from the COM port. This seems to be what is causing the problem. It's not a race condition though - it's consistent.

I need to do this due to the presence of a peek() function which peeks the next character in the stream, and an available() function which returns the # of bytes waiting in the receive buffer. Win32 has no such facilities, so I need to emulate them.

I'm wondering if I can't just cooperatively thread the whole thing. I already have my main application loop where I could poll each com port, but due to separation of the various parts of Winduino I need to expose an uncomfortable amount of serial functionality "publicly" to make that happen.

It kind of makes me want to give up and play fallout, but I really don't want to leave my code in its present state.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix


modified 30-Sep-23 20:59pm.

GeneralRe: So this is fun: a war story Pin
Gary Stachelski 202130-Sep-23 4:31
Gary Stachelski 202130-Sep-23 4:31 
GeneralRe: So this is fun: a war story Pin
honey the codewitch30-Sep-23 4:38
mvahoney the codewitch30-Sep-23 4:38 
GeneralRe: So this is fun: a war story Pin
Graeme_Grant30-Sep-23 5:34
mvaGraeme_Grant30-Sep-23 5:34 
GeneralRe: So this is fun: a war story Pin
honey the codewitch30-Sep-23 8:11
mvahoney the codewitch30-Sep-23 8:11 
GeneralRe: So this is fun: a war story Pin
Graeme_Grant30-Sep-23 15:10
mvaGraeme_Grant30-Sep-23 15:10 
GeneralRe: So this is fun: a war story Pin
honey the codewitch30-Sep-23 15:11
mvahoney the codewitch30-Sep-23 15:11 
GeneralRe: So this is fun: a war story Pin
Graeme_Grant30-Sep-23 15:14
mvaGraeme_Grant30-Sep-23 15:14 
GeneralRe: So this is fun: a war story Pin
Gary Stachelski 202130-Sep-23 8:44
Gary Stachelski 202130-Sep-23 8:44 
GeneralRe: So this is fun: a war story Pin
Mircea Neacsu30-Sep-23 8:06
Mircea Neacsu30-Sep-23 8:06 
GeneralRe: So this is fun: a war story Pin
honey the codewitch30-Sep-23 8:07
mvahoney the codewitch30-Sep-23 8:07 
GeneralRe: So this is fun: a war story Pin
jmaida30-Sep-23 15:08
jmaida30-Sep-23 15:08 
GeneralRe: So this is fun: a war story Pin
honey the codewitch30-Sep-23 15:10
mvahoney the codewitch30-Sep-23 15:10 
GeneralRe: So this is fun: a war story Pin
jmaida30-Sep-23 15:59
jmaida30-Sep-23 15:59 
GeneralRe: So this is fun: a war story Pin
honey the codewitch30-Sep-23 8:09
mvahoney the codewitch30-Sep-23 8:09 
GeneralRe: So this is fun: a war story Pin
Mircea Neacsu30-Sep-23 8:13
Mircea Neacsu30-Sep-23 8:13 
GeneralRe: So this is fun: a war story Pin
honey the codewitch30-Sep-23 8:14
mvahoney the codewitch30-Sep-23 8:14 
GeneralRe: So this is fun: a war story Pin
Mircea Neacsu30-Sep-23 8:16
Mircea Neacsu30-Sep-23 8:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.