Questions tagged [embedded]
For code that targets an embedded device or some severely resource-constrained environment.
137 questions
8
votes
4
answers
462
views
Split flap clock stepper code
I've built a Split Flap Clock, and the code has grown quite a lot, and although it does work in its current state, I am wondering if it could be cleaned up.
The whole thing runs on an ESP32 and is ...
4
votes
2
answers
240
views
C++ wrapper for FreeRTOS blocking queue that can handle complex objects
The FreeRTOS queue is a convenient way for intertask communication on FreeRTOS. But it is written in pain C and therefore it feels a little uncomfortable for C++ programmers. But the main problem is, ...
2
votes
0
answers
109
views
compile time, but Not inlined function in C and C++
We have a graphics library for the Ti84CE, which uses the 24bit eZ80. It has a 16bit 1555 screen, so we have a gfx_Darken function that will darken a 16bit 1555 ...
1
vote
1
answer
104
views
Ensuring data integrity with dual memory structures while using the `offsetof` macro [closed]
I am working with a fairly large data structure that needs to be maintained in RAM in two forms: a standard version and an inverted version. Whenever an element is updated, it must be written to the ...
3
votes
1
answer
243
views
Implements a READ ID command between the iCE40 HX8K and the AT25SF0818 in Verilog
Question
How can I improve my Verilog code?
Context
Flash Read ID Operation
This project is an implimentation of the Read Manufacturer and Device ID (9Fh) operation ...
2
votes
1
answer
69
views
Synchronizing an embedded system with RTOS
I wrote this code for a make-up assignment to pass one of my college class and graduate from my program in the field of electronic and embedded system.
It's pretty much the realization of a solar ...
3
votes
1
answer
72
views
A generic queue that transfers data from interrupt to main program
This code aims to implement a queue, which transfers data from interrupt to main program in a bare metal embedded system. There are two execution points, the main program and the irq handler. Both ...
1
vote
0
answers
77
views
C# like Dependency injection for C++ on embedded device
I was wondering if it would be possible to create a C# like syntax for dependency injection. My device is running constantly and acting more or less like a service. I came up with the following. My ...
2
votes
1
answer
111
views
How to interface a "pull" library with a "push" library using callbacks
I am using a driver that retrieves data from HW (Driver) and a display (Viewer) that will output data to the user.
The user calls a trigger function to initiate the getting of data from the Driver. ...
3
votes
2
answers
152
views
Defining hardware components structure
I'm writing firmware for my Arduino project, and I'm struggling with a clean, scalable hardware mapping structure. Initially, I had the following namespace:
...
4
votes
1
answer
120
views
Arm GPIO driver
I'm new to bare-metal programming. I'm currently developing some drivers for my first project.
This is a simple GPIO driver. I tested it and it's working fine.
What do you guys think of it, and how ...
3
votes
5
answers
258
views
Calculate a math sequence that converges
Thanks for taking the time to read this. I could use a few pointers. I have written much better code but wrote this as a quick test. There is obviously a major issue/s somewhere except for the ...
3
votes
1
answer
143
views
Raspberry Pi/PySimpleGUI based resistance test system
Hardware: Raspberry Pi 3B+, Elecrow touchscreen, DFR0660 Barcode Scanner, ADS1115 ADC
I would like any bad practices/possible failure points pointed out specifically in the ...
14
votes
2
answers
1k
views
Arcsine function for a real-time control program
I have been developing control software for a three-phase induction motor. The main task of this C++ code is to control the torque of the motor. In one part of the algorithm (The control algorithm is ...
7
votes
2
answers
698
views
Arduino library to simplify differential drive robots
I've written code for an Arduino library to abstract away some of the underlying logic in a particular way of moving robots. Code is posted after explanations.
I'm not assuming a high degree of ...