Skip to content
Jerker Dahlblom edited this page Mar 11, 2024 · 6 revisions

addresses

The location of Addresses.h

The developers are still looking for a solution on how to include this header file for the Arduino user. So consider this a temporary fix for the time being.

General information

Every DCS-BIOS control needs some or all values for address, mask or shift. The DCS-BIOS developers, while maintaining the modules tries to keep these values from changing. However, sometimes it isn't possible to avoid changes.

The end result for you when they do change is:

  • sketch stops working
  • value that has changed must be identified
  • sketches must be updated

This can be time-consuming and error prone. There is a file dcs-bios\Scripts\DCS-BIOS\doc\Addresses.h that holds all these values in macros. It is auto-generated when a DCS mission starts.

If you reference these macros instead, the maintenance of your sketches will be much easier when for some reason these values changes. You will still need to compile and re-upload the sketch with the changed Addresses.h but you won’t have to modify your sketches.

Showing the differences using the A-10C CDU 0 button.

Direct assignment:

void onCdu0Change(unsigned int newValue) 
{
		/* your code here */
}
DcsBios::IntegerBuffer cdu0Buffer(0x10f4, 0x1000, 12, onCdu0Change);

DcsBios::LED cdu0(0x10f4, PIN);

Using macro:

void onCdu0Change(unsigned int newValue) 
{
		/* your code here */
}
DcsBios::IntegerBuffer cdu0Buffer(A_10C_CDU_0, onCdu0Change);

DcsBios::LED cdu0(A_10C_CDU_0_AM, PIN);

As you can see you are referencing macros A_10C_CDU_0 & A_10C_CDU_0_AM and Addresses.h holds the actual values for these two macros. Macro values can change but macro name stays the same in your sketch.

Look carefully which macro to use.

  • Macro without special ending contains address, mask, shift
  • _A contains only address
  • _AM contains address and mask

Include Addresses.h to your sketch

#include "C:\Users\<your username>\Saved Games\DCS\Scripts\DCS-BIOS\doc\Addresses.h"