try find out where is the issue
This commit is contained in:
parent
722fb52edb
commit
a9c11f54e2
|
@ -86,13 +86,13 @@ void Error_Handler(void);
|
|||
|
||||
/* USER CODE BEGIN Private defines */
|
||||
#ifdef STS_WS
|
||||
#define HX711_SCK_PIN GPIO_PIN_5
|
||||
#define HX711_DOUT_PIN GPIO_PIN_6
|
||||
#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_PORT GPIOA
|
||||
#define HX711_DOUT_PORT GPIOA
|
||||
#endif
|
||||
/* USER CODE END Private defines */
|
||||
/* USER CODE END Private defines */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -78,25 +78,24 @@ void MX_GPIO_Init(void)
|
|||
GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
HAL_GPIO_Init(BUT3_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
#ifdef STS_WS
|
||||
//STS_Weight_Scale
|
||||
// STS_Weight_Scale
|
||||
|
||||
//HX711_SCK
|
||||
GPIO_InitStruct.Pin = HX711_SCK_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
HAL_GPIO_Init(HX711_SCK_PORT, &GPIO_InitStruct);
|
||||
// HX711_SCK
|
||||
GPIO_InitStruct.Pin = HX711_SCK_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
HAL_GPIO_Init(HX711_SCK_PORT, &GPIO_InitStruct);
|
||||
|
||||
//HX711_DOUT
|
||||
GPIO_InitStruct.Pin = HX711_DOUT_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
HAL_GPIO_Init(HX711_DOUT_PORT, &GPIO_InitStruct);
|
||||
// HX711_DOUT
|
||||
GPIO_InitStruct.Pin = HX711_DOUT_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
HAL_GPIO_Init(HX711_DOUT_PORT, &GPIO_InitStruct);
|
||||
|
||||
HAL_GPIO_WritePin(HX711_SCK_PORT, HX711_SCK_PIN, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(HX711_SCK_PORT, HX711_SCK_PIN, GPIO_PIN_RESET);
|
||||
|
||||
#endif
|
||||
/* EXTI interrupt init*/
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
#include "sts_weight_scale.h"
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
|
@ -85,14 +85,9 @@ int main(void)
|
|||
|
||||
/* Initialize all configured peripherals */
|
||||
MX_GPIO_Init();
|
||||
|
||||
MX_LoRaWAN_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n ----- Start ----- \r\n");
|
||||
|
||||
//sts_weight_scale();
|
||||
|
||||
/* USER CODE END 2 */
|
||||
|
||||
/* Infinite loop */
|
||||
|
@ -100,8 +95,6 @@ int main(void)
|
|||
while (1)
|
||||
{
|
||||
/* USER CODE END WHILE */
|
||||
|
||||
|
||||
MX_LoRaWAN_Process();
|
||||
|
||||
/* USER CODE BEGIN 3 */
|
||||
|
|
|
@ -30,11 +30,11 @@
|
|||
#include "utilities_def.h"
|
||||
#include "sys_debug.h"
|
||||
#include "sys_sensors.h"
|
||||
|
||||
/* USER CODE BEGIN Includes */
|
||||
#ifdef STS_WS
|
||||
#include "sts_weight_scale.h"
|
||||
#endif
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* External variables ---------------------------------------------------------*/
|
||||
|
|
|
@ -641,7 +641,6 @@ static void SendTxData(void)
|
|||
AppData.Buffer[i++] = (uint8_t)(sts_sensor_data.weight_scale_value >> 8& 0xFF);
|
||||
AppData.Buffer[i++] = (uint8_t)(sts_sensor_data.weight_scale_value & 0xFF);
|
||||
#endif
|
||||
|
||||
AppData.BufferSize = i;
|
||||
#endif /* CAYENNE_LPP */
|
||||
|
||||
|
|
|
@ -94,10 +94,10 @@ extern "C" {
|
|||
/*#define REGION_CN470*/
|
||||
/*#define REGION_CN779*/
|
||||
/*#define REGION_EU433*/
|
||||
/*#define REGION_EU868*/
|
||||
#define REGION_EU868
|
||||
/*#define REGION_KR920*/
|
||||
/*#define REGION_IN865*/
|
||||
/*#define REGION_US915*/
|
||||
#define REGION_US915
|
||||
/*#define REGION_RU864*/
|
||||
|
||||
/*!
|
||||
|
|
Loading…
Reference in New Issue