Unification des sources CM4/CM5 : makefiles scindés (common/cm4/cm5/cm5.debug), #ifdef CIBLE_CM5 pour GPIO, correctifs get_ip_address()/signal handler/backtrace, portabilité 32/64 bits
This commit is contained in:
+13
-1
@@ -33,9 +33,11 @@ uint8_t lecture_entree_gpio(uint8_t no, int8_t logique);
|
||||
|
||||
// Variables globales :
|
||||
struct Struct_entrees entrees;
|
||||
|
||||
#ifdef CIBLE_CM5
|
||||
struct gpiod_chip *gpiod_chip0; // Nécessaire pour CM5
|
||||
struct gpiod_line_request *gpiod_entrees_request; // Nécessaire pour CM5
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/**********************************************************************************************************************************************************************************
|
||||
@@ -574,6 +576,7 @@ char tmp[MAX_LONGUEUR_BUFFER_TEMPORAIRE_DEBUG];
|
||||
//====================================================================================================
|
||||
if (systeme.generation_shipbase == GENERATION_SHIPBASE_V3)
|
||||
{
|
||||
#ifdef CIBLE_CM5
|
||||
unsigned int offsets[MAX_NOMBRE_ENTREES_GPIO];
|
||||
uint8_t nb_lignes = 0;
|
||||
|
||||
@@ -627,6 +630,13 @@ char tmp[MAX_LONGUEUR_BUFFER_TEMPORAIRE_DEBUG];
|
||||
|
||||
entrees.gpio.sequenceur.compteur = TEMPO_INIT_ENTREES_GPIO;
|
||||
return(0); // On sort ici : la boucle V1/V2 ci-dessous ne doit pas s'exécuter pour V3
|
||||
|
||||
#else // Compilation pour CM4 donc V1 ou V2. Ne devrait jamais arriver ... :
|
||||
sprintf(tmp, "GENERATION_SHIPBASE_V3 incompatible avec cette plateforme de compilation.");
|
||||
affichage_debug(__FILE__, __LINE__, tmp, TYPE_MESSAGE_DEBUG_ERREUR);
|
||||
return(-1);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -849,12 +859,14 @@ uint8_t lecture_entree_gpio(uint8_t no, int8_t logique)
|
||||
uint8_t x;
|
||||
|
||||
|
||||
#ifdef CIBLE_CM5
|
||||
if (systeme.generation_shipbase == GENERATION_SHIPBASE_V3)
|
||||
{
|
||||
enum gpiod_line_value val = gpiod_line_request_get_value(gpiod_entrees_request, no);
|
||||
x = (val == GPIOD_LINE_VALUE_ACTIVE) ? ON : OFF;
|
||||
}
|
||||
else // Pour V1 & V2 : accès direct aux registres
|
||||
#endif
|
||||
{
|
||||
// Lecture dans les registres du BCM2836 :
|
||||
if (no < 32) // Entrées 0 à 31 :
|
||||
|
||||
Reference in New Issue
Block a user