diff --git a/Core/Inc/main.h b/Core/Inc/main.h index 024c0a7..99a08f0 100644 --- a/Core/Inc/main.h +++ b/Core/Inc/main.h @@ -301,15 +301,20 @@ void Error_Handler(void); #endif #if defined(STS_WS)||defined(STS_R6) -//#define HX711_SCK_PIN GPIO_PIN_5 -//#define HX711_DOUT_PIN GPIO_PIN_6 -//#define HX711_SCK_PORT GPIOA -//#define HX711_DOUT_PORT GPIOA +// #define HX711_SCK_PIN GPIO_PIN_5 +// #define HX711_DOUT_PIN GPIO_PIN_6 +// #define HX711_SCK_PORT GPIOA +// #define HX711_DOUT_PORT GPIOA -#define HX711_SCK_PIN GPIO_PIN_9 -#define HX711_DOUT_PIN GPIO_PIN_10 -#define HX711_SCK_PORT GPIOA -#define HX711_DOUT_PORT GPIOA +// #define HX711_SCK_PIN GPIO_PIN_9 + //#define HX711_DOUT_PIN GPIO_PIN_10 + //#define HX711_SCK_PORT GPIOA + //#define HX711_DOUT_PORT GPIOA + + #define HX711_SCK_PIN GPIO_PIN_6 + #define HX711_DOUT_PIN GPIO_PIN_7 + #define HX711_SCK_PORT GPIOB + #define HX711_DOUT_PORT GPIOB #endif diff --git a/Core/Src/gpio.c b/Core/Src/gpio.c index e86e51a..2d820f8 100644 --- a/Core/Src/gpio.c +++ b/Core/Src/gpio.c @@ -180,7 +180,7 @@ void MX_GPIO_Init(void) // HX711_SCK GPIO_InitStruct.Pin = HX711_SCK_PIN; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_PULLUP; //GPIO_NOPULL + GPIO_InitStruct.Pull = GPIO_PULLUP; //GPIO_PULLUP; //GPIO_NOPULL GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; HAL_GPIO_Init(HX711_SCK_PORT, &GPIO_InitStruct); diff --git a/Core/Src/main.c b/Core/Src/main.c index ed857e0..af82cef 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -111,7 +111,7 @@ int main(void) else #endif { - MX_I2C2_Init(); + //MX_I2C2_Init(); MX_DMA_Init(); #if defined(STS_T6) MX_TIM1_Init(); diff --git a/Core/Src/sys_app.c b/Core/Src/sys_app.c index afbbbb1..a4fcc5b 100644 --- a/Core/Src/sys_app.c +++ b/Core/Src/sys_app.c @@ -142,7 +142,7 @@ void SystemApp_Init(void) #endif #if defined(STS_WS)||defined(STS_R6) - // sts_weight_scale_init(); NO NEED TO INIT FROM VERY BEGINNING + sts_weight_scale_init(); //NO NEED TO INIT FROM VERY BEGINNING #endif diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index 48b6b7c..9a90353 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -476,8 +476,10 @@ void LoRaWAN_Init(void) UTIL_TIMER_Create(&TxLedTimer, LED_PERIOD_TIME, UTIL_TIMER_ONESHOT, OnTxTimerLedEvent, NULL); UTIL_TIMER_Create(&RxLedTimer, LED_PERIOD_TIME, UTIL_TIMER_ONESHOT, OnRxTimerLedEvent, NULL); UTIL_TIMER_Create(&JoinLedTimer, LED_PERIOD_TIME, UTIL_TIMER_PERIODIC, OnJoinTimerLedEvent, NULL); +#if defined(STS_O6T)||defined(STS_O6)||defined(STS_O7) UTIL_TIMER_Create(&STSLampBarColorTimer, LED_PERIOD_TIME, UTIL_TIMER_ONESHOT, OnYunhornSTSLampBarColorTimerEvent, NULL); UTIL_TIMER_Create(&STSDurationCheckTimer, 20*LED_PERIOD_TIME, UTIL_TIMER_PERIODIC, OnYunhornSTSDurationCheckTimerEvent, NULL); +#endif if (FLASH_IF_Init(NULL) != FLASH_IF_OK) { diff --git a/STM32CubeIDE/.cproject b/STM32CubeIDE/.cproject index 33bbb77..b10965e 100644 --- a/STM32CubeIDE/.cproject +++ b/STM32CubeIDE/.cproject @@ -126,6 +126,7 @@