storing input pin in separate variable

pull/2/head
Mateusz Lubecki 2019-08-28 22:16:45 +02:00
rodzic fcf7771d02
commit 7825b575f6
3 zmienionych plików z 2 dodań i 3 usunięć

Wyświetl plik

@ -192,7 +192,7 @@ main(int argc, char* argv[])
TX20Init();
#endif
#ifdef _DALLAS_AS_TELEM
dallas_init(GPIOB, GPIO_Pin_5, GPIO_PinSource5); //
dallas_init(GPIOB, GPIO_Pin_5, GPIO_PinSource5); // B5 output, B6 input
#endif
// initializing UART drvier

Wyświetl plik

@ -24,9 +24,7 @@ extern volatile char timm;
typedef struct DallasStruct {
GPIO_TypeDef* GPIOx; /*!< GPIOx port to be used for I/O functions */
uint16_t GPIO_Pin; /*!< GPIO Pin to be used for I/O functions */
#ifdef _DALLAS_SPLIT_PIN
uint16_t GPIO_Pin_input;
#endif
uint32_t GPIO_Cnf; /*!< GPIO Pin to be used for I/O functions */
uint32_t GPIO_Mode; /*!< GPIO Pin to be used for I/O functions */
uint32_t input_term;

Wyświetl plik

@ -31,6 +31,7 @@ void dallas_init(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, uint16_t GPIO_PinSource
#ifndef _DALLAS_SPLIT_PIN
dallas.GPIOx = GPIOx;
dallas.GPIO_Pin = GPIO_Pin;
dallas.GPIO_Pin_input = GPIO_Pin;
dallas.GPIO_Mode = (3 << GPIO_PinSource * 4);
dallas.GPIO_Cnf = (3 << GPIO_PinSource * 4) + 2;