Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

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‭

9 posts
83%
+8 −0
Q&A Alternative to boolean type for embedded C (ATmega2560)

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...

2 answers  ·  posted 6mo ago by Carl‭  ·  last activity 6mo ago by Olin Lathrop‭

Question c boolean stdbool.h
81%
+7 −0
Q&A Making code MISRA C compliant makes code less readable.

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: ...

1 answer  ·  posted 6mo ago by Carl‭  ·  last activity 5mo ago by wizzwizz4‭

Question c misra-c
77%
+5 −0
Q&A Embedded C - memory pool types

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 -...

2 answers  ·  posted 7d ago by Carl‭  ·  last activity 3d ago by Lundin‭

Question c memory memory-pool static-allocation
77%
+5 −0
Q&A Is there any reason not to use the latest version of MISRA C guidelines?

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...

1 answer  ·  posted 2mo ago by Carl‭  ·  last activity 1mo ago by Lundin‭

Question c misra-c
75%
+4 −0
Q&A Declaring a callback function in usart.h, using it in usart.c but defining it in main.c

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...

3 answers  ·  posted 8d ago by Carl‭  ·  last activity 6d ago by Olin Lathrop‭

Question c callback
71%
+3 −0
Q&A Extern keyword in C and proper way to use extern variables in embedded systems

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...

2 answers  ·  posted 2mo ago by Carl‭  ·  last activity 1mo ago by Lundin‭

Question c embedded extern
66%
+2 −0
Q&A Checking if an array is partially initialized at compile-time

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; ...

1 answer  ·  posted 14d ago by Carl‭  ·  last activity 14d ago by Lundin‭

Question c array
66%
+2 −0
Q&A Avoiding checking opcode multiple times in state machine for embedded system

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...

1 answer  ·  posted 1mo ago by Carl‭  ·  last activity 1mo ago by Lundin‭

Question c state-machine embedded
60%
+1 −0
Q&A Why is private encapsulation "good" in (C) programming?

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...

1 answer  ·  posted 12h ago by Carl‭  ·  last activity 6h ago by Olin Lathrop‭

Question c private-encapsulation