kopia lustrzana https://github.com/SP8EBC/ParaTNC
storing input pin in separate variable
rodzic
fcf7771d02
commit
7825b575f6
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Ładowanie…
Reference in New Issue