wip weight scale

This commit is contained in:
Yunhorn 2024-11-05 19:50:01 +08:00
parent ba108f3c6c
commit 14a219b344
8 changed files with 20 additions and 12 deletions

View File

@ -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

View File

@ -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);

View File

@ -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();

View File

@ -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

View File

@ -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)
{

View File

@ -126,6 +126,7 @@
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.1220095777" name="Core" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" useByScannerDiscovery="false" value="0" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.2109882892" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="YUNHORN-WLE5CC" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.239742593" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.5 || Release || false || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || YUNHORN-WLE5CC || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../../Core/Inc | ../../LoRaWAN/Target | ../../../../../../../Utilities/misc | ../../../../../../../Middlewares/Third_Party/SubGHz_Phy | ../../../../../../../Utilities/lpm/tiny_lpm | ../../../../../../../Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver | ../../../../../../../Drivers/CMSIS/Device/ST/STM32WLxx/Include | ../../../../../../../Utilities/sequencer | ../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler/Packages | ../../LoRaWAN/App | ../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac/Region | ../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc | ../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc/Legacy | ../../../../../../../Utilities/trace/adv_trace | ../../../../../../../Drivers/BSP/STM32WLxx_Nucleo | ../../../../../../../Utilities/timer | ../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac | ../../../../../../../Middlewares/Third_Party/LoRaWAN/Utilities | ../../../../../../../Middlewares/Third_Party/LoRaWAN/Crypto | ../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler | ../../../../../../../Drivers/CMSIS/Include || || || USE_HAL_DRIVER | STM32WL55xx | CORE_CM4 || || || || || ${workspace_loc:/${ProjName}/STM32WLE5CCUX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || " valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.nanoprintffloat.1315515819" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.nanoprintffloat" value="true" valueType="boolean"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.504306143" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
<builder buildPath="${workspace_loc:/LoRaWAN_End_Node}/Release" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.820311016" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1121803732" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">

View File

@ -74,7 +74,7 @@ main-build: WLE5CC_NODE_STS.elf secondary-outputs
# Tool invocations
WLE5CC_NODE_STS.elf WLE5CC_NODE_STS.map: $(OBJS) $(USER_OBJS) D:\ONEDRIVE\STM32WLV13\Projects\NUCLEO-WL55JC\Applications\LoRaWAN\WLE5CC_NODE_STS\STM32CubeIDE\STM32WLE5CCUX_FLASH.ld makefile objects.list $(OPTIONAL_TOOL_DEPS)
arm-none-eabi-gcc -o "WLE5CC_NODE_STS.elf" @"objects.list" $(USER_OBJS) $(LIBS) -mcpu=cortex-m4 -T"D:\ONEDRIVE\STM32WLV13\Projects\NUCLEO-WL55JC\Applications\LoRaWAN\WLE5CC_NODE_STS\STM32CubeIDE\STM32WLE5CCUX_FLASH.ld" --specs=nosys.specs -Wl,-Map="WLE5CC_NODE_STS.map" -Wl,--gc-sections -static -L../../../../../../../Middlewares/ST/STM32_Cryptographic/lib -z noexecstack -Wunused-but-set-variable -Wunused-variable -fshort-enums --specs=nano.specs -mfloat-abi=soft -mthumb -Wl,--start-group -lc -lm -Wl,--end-group
arm-none-eabi-gcc -o "WLE5CC_NODE_STS.elf" @"objects.list" $(USER_OBJS) $(LIBS) -mcpu=cortex-m4 -T"D:\ONEDRIVE\STM32WLV13\Projects\NUCLEO-WL55JC\Applications\LoRaWAN\WLE5CC_NODE_STS\STM32CubeIDE\STM32WLE5CCUX_FLASH.ld" --specs=nosys.specs -Wl,-Map="WLE5CC_NODE_STS.map" -Wl,--gc-sections -static -L../../../../../../../Middlewares/ST/STM32_Cryptographic/lib -z noexecstack -Wunused-but-set-variable -Wunused-variable -fshort-enums --specs=nano.specs -mfloat-abi=soft -mthumb -u _printf_float -Wl,--start-group -lc -lm -Wl,--end-group
@echo 'Finished building target: $@'
@echo ' '