Jump to content

DCS-BIOS Error in Arduino for a-4E


PodxneT

Recommended Posts

I'm creating a display to show the active frequency on the A4, but unfortunately the code to be entered is wrong, the separator lines (-) are not recognized by arduino ide.

 

void onArc51-freq-xxxxxChange(unsigned int newValue) {
    /* your code here */
}
DcsBios::IntegerBuffer arc51-freq-xxxxxBuffer(0x84c6, 0xffff, 0, onArc51-freq-xxxxxChange);

 

does anyone know how to help me ?

Link to comment
Share on other sites

Those are names you can define yourself.
To fix the problem, just replace the - characters with underscore ( _ )  (shift and - ).

And I'll go check the most recent version of the control ref. and get it changed if it's still like this.

EDIT:
It's correct in the latest version - Which version of DCS-BIOS are you using?


Edited by No1sonuk
Link to comment
Share on other sites

19 hours ago, No1sonuk said:

Those are names you can define yourself.
To fix the problem, just replace the - characters with underscore ( _ )  (shift and - ).

And I'll go check the most recent version of the control ref. and get it changed if it's still like this.

EDIT:
It's correct in the latest version - Which version of DCS-BIOS are you using?

 

Thanks for the reply, I'm using the latest version of DCS World Openbeta, it updates automatically.

I tried to replace as you advised me and it works, I thought those calls were to functions written like that. Thank you very much

 

Link to comment
Share on other sites

On 2/17/2024 at 7:57 PM, No1sonuk said:

Ho chiestoquale versione di DCS-BIOS stai utilizzando, non DCS. È possibile che si disponga di una versione precedente e che sia necessario aggiornarla per ottenere il riferimento corretto.

Sorry I misunderstood, the DCS-BIOS version is 0.7.49. I repeat, the problem is not DCS-BIOS but the ARDUINO ide which, as is obvious, does not allow the use of mathematical signs in the name of functions, DCS-BIOS has nothing to do with it. Anyway I solved, as you said, by replacing the (-) with (_), I thought they were references to proprietary functions of dcs-bios but this was not the case. 

Thank you.

  • Like 1
Link to comment
Share on other sites

NP.  Just making sure you weren't using the HUB version (you're not 😉  ).

The latest version of DCS-BIOS Fork doesn't have the "-" character in those locations.

WRT names you can't change, there are some:
e.g. in input functions:

DcsBios::Switch2Pos afcsAlt("AFCS_ALT", PIN);

You can't change "AFCS_ALT" because that's what DCS recognises.
"DcsBios::Switch2Pos" is part of the function definition, and can't be changed either.
"afcsAlt" is a unique name for that instance of the Switch2Pos function, and it CAN be changed.

And in LED output functions (if you have one of the recent versions of the DCS-BIOS Arduino library):

DcsBios::LED extStrobeLeft(A_10C_EXT_STROBE_LEFT, PIN);

"A_10C_EXT_STROBE_LEFT" is a label mapped to address and mask figures that used to be in the reference, but were changed to these names to make updating code easier.
When a DCS update requires the address and mask values to change, users that have these labels in their code only need to recompile the code after updating the library files.
That line looks like this in the old system:

DcsBios::LED extStrobeLeft(0x11bc, 0x4000, PIN);

With the new setup, "A_10C_EXT_STROBE_LEFT" is defined as "0x11bc, 0x4000" in the addresses file.  If that part needs to change, the "A_10C_EXT_STROBE_LEFT" definition will be updated as part of the library update, meaning the users don't need to track down and change all the addresses and masks that were affected.
As before, "DcsBios::LED" is the non-changeable function definition and "extStrobeLeft" is the changeable unique name of that instance.

In case you're wondering about why you would want to change the instance name, consider if you want two pins to respond to the same light signal for some reason.
This would fail to compile because the names are not unique:

DcsBios::LED extStrobeLeft(A_10C_EXT_STROBE_LEFT, 2);
DcsBios::LED extStrobeLeft(A_10C_EXT_STROBE_LEFT, 3);

This WOULD work because the names are unique:

DcsBios::LED extStrobeLeftA(A_10C_EXT_STROBE_LEFT, 2);
DcsBios::LED extStrobeLeftB(A_10C_EXT_STROBE_LEFT, 3);

 

  • Like 1
Link to comment
Share on other sites

On 2/18/2024 at 11:02 PM, No1sonuk said:

NP. Assicurati solo di non utilizzare la versione HUB (non 😉 lo sei).

L'ultima versione di DCS-BIOS Fork non ha il carattere "-" in queste posizioni.

Nomi WRT che non si possono modificare, ce ne sono alcuni: ad esempio nelle funzioni di input:

DcsBios::Switch2Pos afcsAlt("AFCS_ALT", PIN);

Non è possibile modificare "AFCS_ALT" perché è ciò che DCS riconosce.
"DcsBios::Switch2Pos" fa parte della definizione della funzione e non può essere modificato.
"afcsAlt" è un nome univoco per l'istanza della funzione Switch2Pos e PUÒ essere modificato.

E nelle funzioni di uscita LED (se si dispone di una delle versioni recenti della libreria DCS-BIOS Arduino):

DcsBios::LED extStrobeLeft(A_10C_EXT_STROBE_LEFT, PIN);

"A_10C_EXT_STROBE_LEFT" è un'etichetta mappata alle cifre dell'indirizzo e della maschera che erano presenti nel riferimento, ma sono state modificate con questi nomi per semplificare l'aggiornamento del codice.
Quando un aggiornamento DCS richiede la modifica dei valori dell'indirizzo e della maschera, gli utenti che hanno queste etichette nel codice devono solo ricompilare il codice dopo aver aggiornato i file della libreria.
Quella riga è simile a questa nel vecchio sistema:

DcsBios::LED extStrobeLeft(0x11bc, 0x4000, PIN);

Con la nuova configurazione, "A_10C_EXT_STROBE_LEFT" è definito come "0x11bc, 0x4000" nel file degli indirizzi. Se questa parte deve essere modificata, la definizione "A_10C_EXT_STROBE_LEFT" verrà aggiornata come parte dell'aggiornamento della libreria, il che significa che gli utenti non devono rintracciare e modificare tutti gli indirizzi e le maschere interessate.
Come in precedenza, "DcsBios::LED" è la definizione di funzione non modificabile e "extStrobeLeft" è il nome univoco modificabile di tale istanza.

Nel caso in cui ti stia chiedendo perché vorresti cambiare il nome dell'istanza, considera se vuoi che due pin rispondano allo stesso segnale luminoso per qualche motivo.
Questa operazione non verrebbe compilata perché i nomi non sono univoci:

DcsBios::LED extStrobeLeft(A_10C_EXT_STROBE_LEFT, 2);
DcsBios::LED extStrobeLeft(A_10C_EXT_STROBE_LEFT, 3);

Questo funzionerebbe perché i nomi sono univoci:

DcsBios::LED extStrobeLeftA(A_10C_EXT_STROBE_LEFT, 2);
DcsBios::LED extStrobeLeftB(A_10C_EXT_STROBE_LEFT, 3);

 

Ok thank you.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...