Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Posts by Carl
I'm working on writing drivers for the peripherals in my ATmega2560 microcontroller. One of these is a USART which has the option of being double speed or normal speed. If this was C for the PC I w...
I've started rewriting some of my old C-code projects such that they comply with the MISRA C standards. I've noticed that literally all of them break rule 10.3 from the C:2012 guideline document: ...
In embedded systems, dynamic memory allocation is discouraged (or forbidden) due to various reasons. A better idea is to statically allocate a chunk of memory whose size is known at compile time -...
I am contemplating on purchasing a personal copy of the MISRA C guideline document. Looking at their website shows several different versions - MISRA C:2025, MISRA C:2012 3rd ed., MISRA C:2004, etc...
I have written a generic device driver for a uart peripheral with a source file usart.c and a header file usart.h. I don't want a user of these files have to tamper with them. I want to use the us...
I have an 8-bit microcontroller with 100 pins. Each pin belongs to a port with a unique address and each pin has a number from 0 to 7. I want to create a scheme where in the code each pin is a stru...
I have the following code in my project typedef enum { RELAY_CHANNEL_PIN_5, RELAY_CHANNEL_PIN_6, RELAY_CHANNEL_PIN_7, RELAY_CHANNEL_PIN_8, RELAY_CHANNELS_N } relay_channel_pin_t; ...
I am implementing a state machine for an electrical relay control board and am trying to follow the principles/structure presented by Lundin here for doing that in C. My machine has currently four...
I have read several times that it is implied that it is "good" programming style to have private encapsulation. But I'm curious to know what exactly makes it good. For example, the code below does...
