Kenneth Wada

image
President

I am a embedded systems consultant in Silicon Valley California.

krwada

's contributions
Articles
Comments
    • I have many clients who do both as you suggest. The combined solution works extremely well. I also have clients who do not want to add an extra penny if they can help it ... for this, you need some kind of software filter.

    • It really depends on the processor that you use. On some processors, if you use the int type and the integer native is 16-bits, and the processor happens to be an 8-bit machine, then the index update is not atomic at all. The best way to figure this out is to use the diss-assembly switch on your compiler to see if you need this. As with all things embedded, one cannot assume anything. Also, one cannot generalize ... like I just did. Pre-emption is a seriously tricky business ... especially with drivers and with queues. Most of the fixes I have implemented on device drivers usually in the arena of pre-emption and protection. This is where most of the problems occur. It is also extremely difficult to debug problems like this. When I am debugging some drivers that were not written by me, this is usually the very first place I look. Also, I must admit, I have made a few mistakes here in the past too. Heck ... I know I can start another topic on pre-emption and protection ... and I can guarantee that there will be a ton of criticisms and comments on this too!

    • Hello Lundin; Yes, I think I did misunderstand what you meant. So, in your proposal, the struct definition would be hidden. How would the function call in C be implemented ... without an object that is? Would all the instances be carried in the C source file?