Questions tagged [embedded]
For code that targets an embedded device or some severely resource-constrained environment.
135 questions
2votes
0answers
67views
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 ...
2votes
1answer
83views
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 ...
2votes
1answer
219views
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 ...
2votes
1answer
52views
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 ...
3votes
1answer
58views
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 ...
0votes
0answers
63views
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 ...
2votes
1answer
89views
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. ...
3votes
2answers
132views
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: ...
4votes
1answer
97views
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 ...
3votes
5answers
182views
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 ...
3votes
1answer
113views
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 ...
14votes
2answers
1kviews
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 ...
7votes
2answers
650views
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 ...
6votes
2answers
590views
Drift correction for sensor readings using a high-pass filter
An embedded project my team is working on is having issues with sensor drift over time. To solve this, I thought it might work to use a high-pass filter, since the portion of the signal that we care ...
1vote
1answer
191views
Implementation of the driver for the speed sensor
I have been developing a C++ driver for the incremental rotary encoder (irc) based speed sensor. It is a part of my embedded software project. The driver is basically decomposed into two layers: The ...