diff --git a/Logiciel/Firmware_testeur/Drivers/sept_segments_port_stm32f071v8.c b/Logiciel/Firmware_testeur/Drivers/sept_segments_port_stm32f071v8.c index b70efddf4a42508f412f6c438d0a11be57dc7f57..ef59a6cb1861ef874736a9577bf19e4a86309da2 100644 --- a/Logiciel/Firmware_testeur/Drivers/sept_segments_port_stm32f071v8.c +++ b/Logiciel/Firmware_testeur/Drivers/sept_segments_port_stm32f071v8.c @@ -6,7 +6,6 @@ */ #include "sept_segments_port_stm32f071v8.h" -#include "main.h" #include <string.h> // Fonctions privées @@ -24,7 +23,6 @@ GPIO_PinState convertirEtat(SeptSegment_Etat etat) { // Fonctions publiques void SeptSegment_Port_init (SeptSegment_Port* ecran, GPIO_TypeDef** ports, uint16_t* broches) { - SeptSegment base; SeptSegment_allumerSegment_ptr allumerPort = { (void*) SeptSegment_Port_allumerA, (void*) SeptSegment_Port_allumerB, @@ -34,8 +32,7 @@ void SeptSegment_Port_init (SeptSegment_Port* ecran, (void*) SeptSegment_Port_allumerF, (void*) SeptSegment_Port_allumerG }; - SeptSegment_init(&base, allumerPort); - ecran->base_ = base; + SeptSegment_init(&(ecran->base_), allumerPort); memcpy(ecran->ports_, ports, N_SEGMENTS*sizeof(*ports)); memcpy(ecran->broches_, broches, N_SEGMENTS*sizeof(*broches)); } @@ -44,6 +41,10 @@ void SeptSegment_Port_afficher (SeptSegment_Port* ecran, unsigned char caractere SeptSegment_afficher(&(ecran->base_), caractere); } +void SeptSegment_Port_eteindre (SeptSegment_Port* ecran) { + SeptSegment_eteindre(&(ecran->base_)); +} + void SeptSegment_Port_allumerA (SeptSegment_Port* ecran, SeptSegment_Etat etat) { HAL_GPIO_WritePin(ecran->ports_[SEG_A], ecran->broches_[SEG_A], convertirEtat(etat)); } diff --git a/Logiciel/Firmware_testeur/Drivers/sept_segments_port_stm32f071v8.h b/Logiciel/Firmware_testeur/Drivers/sept_segments_port_stm32f071v8.h index ef5e92f6482e54c3eca9beae4944e9ed9b4cae5c..3619eb98888304143f9078ae7be6fcb3894b098c 100644 --- a/Logiciel/Firmware_testeur/Drivers/sept_segments_port_stm32f071v8.h +++ b/Logiciel/Firmware_testeur/Drivers/sept_segments_port_stm32f071v8.h @@ -9,7 +9,7 @@ #define SEPT_SEGMENTS_PORT_STM32F071V8_H_ #include "sept_segments.h" -#include "stm32f071xb.h" +#include "main.h" typedef struct { SeptSegment base_; @@ -20,6 +20,7 @@ typedef struct { void SeptSegment_Port_init (SeptSegment_Port* ecran, GPIO_TypeDef** ports, uint16_t* broches); void SeptSegment_Port_afficher (SeptSegment_Port* ecran, unsigned char caractere); +void SeptSegment_Port_eteindre (SeptSegment_Port* ecran); void SeptSegment_Port_allumerA (SeptSegment_Port* ecran, SeptSegment_Etat etat); void SeptSegment_Port_allumerB (SeptSegment_Port* ecran, SeptSegment_Etat etat);