Skip to main content
8 votes
Accepted

MemoryGraveyardDriver.sys - a kernel mode device driver managing a kilobyte of RAM for random reading/writing

Make more functions static I think the functions MyCreateClose, MyRead, ...
G. Sliepen's user avatar
  • 69.3k
4 votes
Accepted

Software drivers for the mcu peripherals in C++

Avoid the placement new The placement new you are doing looks redundant. PeripheralRegs is a ...
G. Sliepen's user avatar
  • 69.3k
4 votes

usart driver wrapper

Consider using enum class Instead of having a regular enum inside its own namespace, use an ...
G. Sliepen's user avatar
  • 69.3k
4 votes
Accepted

Software driver for digital inputs expander communicating over SPI

Add include guards I am not seeing any include guards in your code. It is common practice to add those to header files; this allows them to depend on other header files without having to worry about ...
G. Sliepen's user avatar
  • 69.3k
3 votes
Accepted

Usart Network driver

Weird enum values Why does stmfrm_state start at 0x8000, and then goes down? Also, if the enum names all start with SMFRM_WAIT_AA...
G. Sliepen's user avatar
  • 69.3k
3 votes

Software driver for analog to digital converter

const You need more of it, in several places. Methods like these: ...
Reinderien's user avatar
  • 71.1k
2 votes

Motor control PLC in Python

Naming The class name Fn_Motor1D is not very descriptive. I recommend spelling out whatever Fn stands for. Some of the function ...
toolic's user avatar
  • 15.8k
2 votes

Software driver for digital inputs expander communicating over SPI

Consistency Starting with the enums - be consistent if you're going to number each one or not. Personally I prefer to not number them, and if I have constants (as returns from I2C, etc) then those are ...
Alex Shirley's user avatar
2 votes

ROS node to control Dynamixel servo motors

General observation Pack all your code into a personal namespace , you have no reason to don't do it. Modify your includes directory to point also to ...
Calak's user avatar
  • 2,411
2 votes
Accepted

Windows: Programmatically uninstall the NumberPad from ASUS ZenBook

Low hanging fruits: L"{4d36e96b-e325-11ce-bfc1-08002be10318}" looks like a magic number to me. If I understand correctly, it is a GUID of NumberPad; if ...
vnp's user avatar
  • 58.7k
1 vote

Implementation of the driver for the speed sensor

Some questions about the FPGA interface There are some questions that I have when I look at the interface you are using. You mention an FPGA that presumely is doing the quadrature decoding and ...
G. Sliepen's user avatar
  • 69.3k
1 vote

Device driver abstraction layer in C++

The idea is good, but it can be improved. First, decouple the register types from their address. Consider for example that an MCU might have multiple instances of an UART, and you want to declare a <...
G. Sliepen's user avatar
  • 69.3k
1 vote

Linux GPIO rotary encoder as volume control

As you say, the device matching doesn't work properly, and doesn't allow you to use more than one of these encoders at once. What you need to do is to match against Device Tree entries. This is a ...
Toby Speight's user avatar
  • 88.3k
1 vote

Verilog UART Transmitter

I agree with the suggestions in Greg's answer. Here are some further considerations, mostly for coding style. Large numbers like 100000000 are hard to read. Use ...
toolic's user avatar
  • 15.8k
1 vote

VGA sync generator for 640x480@60Hz

If you had ran simulation or loaded onto FPGA, you would noticed you didn't get the expected behavior. Run simulation and look at waveforms before loading to FPGA. You have ...
Greg's user avatar
  • 523
1 vote

De-bouncing a (Gray) Rotary Encoder Switch in C

I don't see why bother with clipping averages. If something was less than ROTSW_MIN, it is also less than ROTSW_LOWER. ...
vnp's user avatar
  • 58.7k

Only top scored, non community-wiki answers of a minimum length are eligible