diff --git a/README.md b/README.md index f0ab5f7..152a2bf 100644 --- a/README.md +++ b/README.md @@ -2,24 +2,12 @@ -->main - 最小硬件初始化 - ->时钟 - 对外暴露的时钟 - ->看门狗 - ->UART - - 最小软件初始化 - FLASH配置 - - 启动软件 - 检查ID - ID == 0,灯光调试指示灯快闪 - - ID == 1, - 初始化相应的硬件 - - +subboard20_plate_clamp_case OK +subboard30_shake_module OK +subboard60_inlet_and_outlet_module OK +subboard70_incubation_turntable +subboard80_cliptip +subboard90_optical_module ``` diff --git a/sdk b/sdk index 563e4ca..cae0c02 160000 --- a/sdk +++ b/sdk @@ -1 +1 @@ -Subproject commit 563e4ca7f479b028da851852ebec4fdfad95482e +Subproject commit cae0c02a77a7fde8ab474dd888fd2d56e796c3e4 diff --git a/usrc/main.cpp b/usrc/main.cpp index f6b38f5..5cdcc37 100644 --- a/usrc/main.cpp +++ b/usrc/main.cpp @@ -91,8 +91,8 @@ void umain() { board_init(); Pin_t debugLight = PC_DEBUG_LIGHT_GPIO; - if (deviceId == 20) { - debugLight = PC_SUBBOARD20_LIGHT_GPIO; + if (deviceId == 20 || deviceId == 80) { + debugLight = PC_SUBBOARD_20_80_LIGHT_GPIO; } zos_cfg_t zoscfg = {0}; diff --git a/usrc/project_configs.h b/usrc/project_configs.h index 91e6740..a96040d 100644 --- a/usrc/project_configs.h +++ b/usrc/project_configs.h @@ -4,10 +4,10 @@ #define PC_PROJECT_NAME "a8000_subboard" #define PC_IFLYTOP_ENABLE_OS 1 -#define PC_DEBUG_UART huart1 -#define PC_DEBUG_UART_RX_BUF_SIZE 1024 -#define PC_DEBUG_LIGHT_GPIO PE2 -#define PC_SUBBOARD20_LIGHT_GPIO PE8 +#define PC_DEBUG_UART huart1 +#define PC_DEBUG_UART_RX_BUF_SIZE 1024 +#define PC_DEBUG_LIGHT_GPIO PE2 +#define PC_SUBBOARD_20_80_LIGHT_GPIO PE8 // #define PC_SYS_DELAY_US_TIMER htim6 // US延时定时器 diff --git a/usrc/public_service/instance_init.hpp b/usrc/public_service/instance_init.hpp index 69a1ec9..1117ed4 100644 --- a/usrc/public_service/instance_init.hpp +++ b/usrc/public_service/instance_init.hpp @@ -1,10 +1,10 @@ #define TMC5130_MOTOR_INITER(MOTOR_INDEX, _id) \ { \ - static TMC5130 motor; \ + static TMC51X0 motor; \ static StepMotorCtrlModule module; \ int subid = _id; \ \ - TMC5130::cfg_t tmc5130cfg = { \ + TMC51X0::cfg_t tmc5130cfg = { \ .spi = &TMC_MOTOR_SPI, \ .csgpio = MOTOR##MOTOR_INDEX##_CSN, \ .ennPin = MOTOR##MOTOR_INDEX##_ENN, \ diff --git a/usrc/subboards/subboard20_plate_clamp_case/pri_board.h b/usrc/subboards/subboard20_plate_clamp_case/pri_board.h index 67875d7..2210d8c 100644 --- a/usrc/subboards/subboard20_plate_clamp_case/pri_board.h +++ b/usrc/subboards/subboard20_plate_clamp_case/pri_board.h @@ -51,7 +51,7 @@ #define MOTOR1_STEPMOTOR_IHOLD 3 #define MOTOR1_STEPMOTOR_IRUN 16 #define MOTOR1_STEPMOTOR_IHOLDDELAY 100 -#define MOTOR1_STEPMOTOR_IGLOBALSCALER 1 +#define MOTOR1_STEPMOTOR_IGLOBALSCALER 0 #define MOTOR1_MOTOR_DEFAULT_ACC 300 #define MOTOR1_MOTOR_DEFAULT_DEC 300 #define MOTOR1_MOTOR_DEFAULT_VELOCITY 500 diff --git a/usrc/subboards/subboard30_shake_module/pri_board.h b/usrc/subboards/subboard30_shake_module/pri_board.h index 17081b1..30aa52d 100644 --- a/usrc/subboards/subboard30_shake_module/pri_board.h +++ b/usrc/subboards/subboard30_shake_module/pri_board.h @@ -42,7 +42,7 @@ #define MOTOR1_STEPMOTOR_IHOLD 2 #define MOTOR1_STEPMOTOR_IRUN 8 #define MOTOR1_STEPMOTOR_IHOLDDELAY 100 -#define MOTOR1_STEPMOTOR_IGLOBALSCALER 1 +#define MOTOR1_STEPMOTOR_IGLOBALSCALER 0 #define MOTOR1_MOTOR_DEFAULT_ACC 300 #define MOTOR1_MOTOR_DEFAULT_DEC 300 #define MOTOR1_MOTOR_DEFAULT_VELOCITY 150 diff --git a/usrc/subboards/subboard60_inlet_and_outlet_module/pri_board.h b/usrc/subboards/subboard60_inlet_and_outlet_module/pri_board.h index 2680cb2..da62dd0 100644 --- a/usrc/subboards/subboard60_inlet_and_outlet_module/pri_board.h +++ b/usrc/subboards/subboard60_inlet_and_outlet_module/pri_board.h @@ -47,7 +47,7 @@ #define MOTOR1_STEPMOTOR_IHOLD 2 #define MOTOR1_STEPMOTOR_IRUN 24 #define MOTOR1_STEPMOTOR_IHOLDDELAY 100 -#define MOTOR1_STEPMOTOR_IGLOBALSCALER 1 +#define MOTOR1_STEPMOTOR_IGLOBALSCALER 0 #define MOTOR1_MOTOR_DEFAULT_ACC 300 #define MOTOR1_MOTOR_DEFAULT_DEC 300 #define MOTOR1_MOTOR_DEFAULT_VELOCITY 300 diff --git a/usrc/subboards/subboard70_incubation_turntable/pri_board.h b/usrc/subboards/subboard70_incubation_turntable/pri_board.h index 8c92677..8fec5ba 100644 --- a/usrc/subboards/subboard70_incubation_turntable/pri_board.h +++ b/usrc/subboards/subboard70_incubation_turntable/pri_board.h @@ -45,16 +45,16 @@ #define TMC_MOTOR_SPI hspi1 #define MOTOR1_CSN PA4 -#define MOTOR1_ENN PE3 +#define MOTOR1_ENN PinNull #define MOTOR1_SPI_MODE_SELECT PinNull #define MOTOR1_nFREEZE_IO PE12 #define MOTOR1_nRESET_IO PinNull #define MOTOR1_SUB_IC_ENN_IO PE11 -#define MOTOR1_REFL PinNull -#define MOTOR1_REFR PinNull -#define MOTOR1_REFL_MIRROR false -#define MOTOR1_REFR_MIRROR false +#define MOTOR1_REFL PD3 +#define MOTOR1_REFR PD2 +#define MOTOR1_REFL_MIRROR true +#define MOTOR1_REFR_MIRROR true #define MOTOR1_MOTOR_SHAFT false // #define MOTOR1_MOTOR_ONE_CIRCLE_PULSE 387096 // 3600 = 93圈, 3600/93 = 38.70967741935484 @@ -62,7 +62,7 @@ #define MOTOR1_STEPMOTOR_IHOLD 1 #define MOTOR1_STEPMOTOR_IRUN 5 #define MOTOR1_STEPMOTOR_IHOLDDELAY 100 -#define MOTOR1_STEPMOTOR_IGLOBALSCALER 1 +#define MOTOR1_STEPMOTOR_IGLOBALSCALER 0 #define MOTOR1_MOTOR_DEFAULT_ACC 900 #define MOTOR1_MOTOR_DEFAULT_DEC 900 #define MOTOR1_MOTOR_DEFAULT_VELOCITY 300 diff --git a/usrc/subboards/subboard70_incubation_turntable/subboard70_incubation_turntable.cpp b/usrc/subboards/subboard70_incubation_turntable/subboard70_incubation_turntable.cpp index d3ea487..4991463 100644 --- a/usrc/subboards/subboard70_incubation_turntable/subboard70_incubation_turntable.cpp +++ b/usrc/subboards/subboard70_incubation_turntable/subboard70_incubation_turntable.cpp @@ -13,7 +13,9 @@ extern "C" { #define TAG "ShakeModule" using namespace iflytop; +#define TAG "Subboard70IncubationTurntable" void Subboard70IncubationTurntable::initialize() { + ZLOGI(TAG, "suboard 70 initialize"); IO_INIT(); GService::inst()->getZCanProtocolParser()->registerModule(this); diff --git a/usrc/subboards/subboard80_cliptip/pri_board.h b/usrc/subboards/subboard80_cliptip/pri_board.h index fa4b25f..ca851a6 100644 --- a/usrc/subboards/subboard80_cliptip/pri_board.h +++ b/usrc/subboards/subboard80_cliptip/pri_board.h @@ -49,7 +49,7 @@ #define MOTOR1_STEPMOTOR_IHOLD 1 #define MOTOR1_STEPMOTOR_IRUN 8 #define MOTOR1_STEPMOTOR_IHOLDDELAY 100 -#define MOTOR1_STEPMOTOR_IGLOBALSCALER 1 +#define MOTOR1_STEPMOTOR_IGLOBALSCALER 0 #define MOTOR1_MOTOR_DEFAULT_ACC 300 #define MOTOR1_MOTOR_DEFAULT_DEC 300 #define MOTOR1_MOTOR_DEFAULT_VELOCITY 500 diff --git a/usrc/subboards/subboard80_cliptip/subboard80_cliptip_board.c b/usrc/subboards/subboard80_cliptip/subboard80_cliptip_board.c index ca9b721..020ae03 100644 --- a/usrc/subboards/subboard80_cliptip/subboard80_cliptip_board.c +++ b/usrc/subboards/subboard80_cliptip/subboard80_cliptip_board.c @@ -175,13 +175,9 @@ static void UART4_Init() { huart4_enable = true; } -/** - * @brief 移液体枪串口 - */ - void subboard80_cliptip_board_init() { common_hardware_init(); MX_SPI1_Init(); - UART2_Init(); // 移动液枪串口初始化 + UART2_Init(); UART4_Init(); } diff --git a/usrc/subboards/subboard90_optical_module/pri_board.h b/usrc/subboards/subboard90_optical_module/pri_board.h index f8c9127..43df0c9 100644 --- a/usrc/subboards/subboard90_optical_module/pri_board.h +++ b/usrc/subboards/subboard90_optical_module/pri_board.h @@ -50,7 +50,7 @@ #define MOTOR1_STEPMOTOR_IHOLD 1 #define MOTOR1_STEPMOTOR_IRUN 8 #define MOTOR1_STEPMOTOR_IHOLDDELAY 100 -#define MOTOR1_STEPMOTOR_IGLOBALSCALER 1 +#define MOTOR1_STEPMOTOR_IGLOBALSCALER 0 #define MOTOR1_MOTOR_DEFAULT_ACC 300 #define MOTOR1_MOTOR_DEFAULT_DEC 300 #define MOTOR1_MOTOR_DEFAULT_VELOCITY 500