1
Vos projets / Re : Une manette PlayStation PS3 sans fil pour LaBox.
« le: septembre 09, 2025, 09:12:39 pm »
Joli projet. Comme quoi Labox est un programme bien extensible !
Le forum LOCODUINO est consacré aux discussions ayant trait à l'utilisation de l'Arduino dans les automatismes et les animations pour le train miniature. Nous avons eu récemment quelques inscriptions de personnes ayant des projets plus généraux mais surtout inapplicables au train miniature. Si votre projet ou vos questions ne concernent pas le modélisme ferroviaire, ne vous inscrivez pas, vous perdriez votre temps et nous aussi.
Cette section vous permet de consulter les contributions (messages, sujets et fichiers joints) d'un utilisateur. Vous ne pourrez voir que les contributions des zones auxquelles vous avez accès.
if (isMain) {
ch = 0;
plen = PREAMBLE_BITS_MAIN;
static_assert (DATA_LEN(MAX_PACKET_SIZE+1) + PREAMBLE_BITS_MAIN + 2 <= RMT_CHAN_PER_DCC_CHAN * SOC_RMT_MEM_WORDS_PER_CHANNEL,
"Number of DCC packet bits greater than ESP32 RMT memory available");
} else {
ch = RMT_CHAN_PER_DCC_CHAN; // number == offset
plen = PREAMBLE_BITS_PROG;
static_assert (DATA_LEN(MAX_PACKET_SIZE+1) + PREAMBLE_BITS_PROG + 2 <= RMT_CHAN_PER_DCC_CHAN * SOC_RMT_MEM_WORDS_PER_CHANNEL,
"Number of DCC packet bits greater than ESP32 RMT memory available");
}
/*
According to the kind of track configuration, there is 3 possible behaviors :
- The base configuration is a prog track only, which joins the main track for normal operations.
In that case, the program behavior is "joining". This is the default configuration.
- If there is a Main track and boosters, the program behavior is "rebooting" the system to change
the configuration. This does not always work with Railcom.
- If there is a Main and a Prog track, the program behavior is "normal".
A Main track only configuration is not anymore necessary, as the prog track can join the main track.
Name Config main prog
Prog only NULL PROG NULL NULL joined unjoined
Main only MAIN NULL NULL NULL reboot (not railcom) reboot
Main+boosts MAIN NULL BOOST1 BOOST2 reboot (not railcom) reboot
Both MAIN PROG NULL NULL normal normal
Both+boost MAIN PROG BOOST NULL normal normal
*/
Le seul cas litigieux concerne l'usage de boosters sans voie de programmation. Ce mode réclame encore de rebooter (c'est géré), mais ça ne marche pas toujours... Le seule solution reste de rebooter physiquement l'ESP.2) Réutilisé la variable dp_rc comme sur la version précédente (+/- ligne 151)
/**
* @brief Restart PRO and APP CPUs.
*
* This function can be called both from PRO and APP CPUs.
* After successful restart, CPU reset reason will be SW_CPU_RESET.
* Peripherals (except for WiFi, BT, UART0, SPI1, and legacy timers) are not reset.
* This function does not return.
*/
void esp_restart(void) __attribute__ ((noreturn));