Browse Source

update

master
zhaohe 1 year ago
parent
commit
917ac8b9df
  1. 28
      usrc/main.cpp
  2. 2
      usrc/project_configs.h
  3. 24
      usrc/subboards/subboard20_plate_clamp_case/pri_board.h

28
usrc/main.cpp

@ -7,6 +7,8 @@
#include "sdk/os/zos.hpp" #include "sdk/os/zos.hpp"
#include "sysmgr/sys_mgr.hpp" #include "sysmgr/sys_mgr.hpp"
// //
#include "subboards/subboard20_plate_clamp_case/subboard20_plate_clamp_case.hpp"
#include "subboards/subboard20_plate_clamp_case/subboard20_plate_clamp_case_board.h"
#include "subboards/subboard30_shake_module/subboard30_shake_module.hpp" #include "subboards/subboard30_shake_module/subboard30_shake_module.hpp"
#include "subboards/subboard30_shake_module/subboard30_shake_module_board.h" #include "subboards/subboard30_shake_module/subboard30_shake_module_board.h"
#include "subboards/subboard60_inlet_and_outlet_module/subboard60_inlet_and_outlet_module.hpp" #include "subboards/subboard60_inlet_and_outlet_module/subboard60_inlet_and_outlet_module.hpp"
@ -15,6 +17,8 @@
#include "subboards/subboard70_incubation_turntable/subboard70_incubation_turntable_board.h" #include "subboards/subboard70_incubation_turntable/subboard70_incubation_turntable_board.h"
#include "subboards/subboard80_cliptip/subboard80_cliptip.hpp" #include "subboards/subboard80_cliptip/subboard80_cliptip.hpp"
#include "subboards/subboard80_cliptip/subboard80_cliptip_board.h" #include "subboards/subboard80_cliptip/subboard80_cliptip_board.h"
#include "subboards/subboard90_optical_module/subboard90_optical_module.hpp"
#include "subboards/subboard90_optical_module/subboard90_optical_module_board.h"
// //
@ -31,22 +35,24 @@ int32_t deviceId = 0;
static void board_init() { static void board_init() {
switch (deviceId) { switch (deviceId) {
case 20: // 板夹仓
subboard20_plate_clamp_case_board_init();
break;
case 30: // 摇匀模组 case 30: // 摇匀模组
subboard30_shake_module_board_init(); subboard30_shake_module_board_init();
break; break;
case 60: // 进出料模组 case 60: // 进出料模组
subboard60_inlet_and_outlet_module_board_init(); subboard60_inlet_and_outlet_module_board_init();
break; break;
case 70: // 孵化转盘 case 70: // 孵化转盘
subboard70_incubation_turntable_board_init(); subboard70_incubation_turntable_board_init();
break; break;
case 80: case 80:
subboard80_cliptip_board_init(); subboard80_cliptip_board_init();
break; break;
case 90:
subboard90_optical_module_board_init();
break;
default: default:
common_hardware_init(); common_hardware_init();
break; break;
@ -56,6 +62,9 @@ static void board_init() {
static void board_post_init() { static void board_post_init() {
GService::inst()->initialize(); GService::inst()->initialize();
switch (deviceId) { switch (deviceId) {
case 20:
Subboard20PlateClampCase::ins()->initialize();
break;
case 30: // 摇匀模组 case 30: // 摇匀模组
Subboard30ShakeModule::ins()->initialize(); Subboard30ShakeModule::ins()->initialize();
break; break;
@ -68,7 +77,9 @@ static void board_post_init() {
case 80: case 80:
Subboard80Cliptip::ins()->initialize(); Subboard80Cliptip::ins()->initialize();
break; break;
// case 90:
// Subboard90OpticalModule::ins()->initialize();
// break;
default: default:
break; break;
} }
@ -79,12 +90,17 @@ void umain() {
board_init(); board_init();
Pin_t debugLight = PC_DEBUG_LIGHT_GPIO;
if (deviceId == 20) {
debugLight = PC_SUBBOARD20_LIGHT_GPIO;
}
zos_cfg_t zoscfg = {0}; zos_cfg_t zoscfg = {0};
chip_cfg_t chipcfg = {}; chip_cfg_t chipcfg = {};
chipcfg.us_dleay_tim = &PC_SYS_DELAY_US_TIMER; chipcfg.us_dleay_tim = &PC_SYS_DELAY_US_TIMER;
chipcfg.tim_irq_scheduler_tim = &PC_SYS_TIM_IRQ_SCHEDULER_TIMER; chipcfg.tim_irq_scheduler_tim = &PC_SYS_TIM_IRQ_SCHEDULER_TIMER;
chipcfg.huart = &PC_DEBUG_UART; chipcfg.huart = &PC_DEBUG_UART;
chipcfg.debuglight = PC_DEBUG_LIGHT_GPIO;
chipcfg.debuglight = debugLight;
chip_init(&chipcfg); chip_init(&chipcfg);
zos_init(&zoscfg); zos_init(&zoscfg);

2
usrc/project_configs.h

@ -7,6 +7,8 @@
#define PC_DEBUG_UART huart1 #define PC_DEBUG_UART huart1
#define PC_DEBUG_UART_RX_BUF_SIZE 1024 #define PC_DEBUG_UART_RX_BUF_SIZE 1024
#define PC_DEBUG_LIGHT_GPIO PE2 #define PC_DEBUG_LIGHT_GPIO PE2
#define PC_SUBBOARD20_LIGHT_GPIO PE8
//
#define PC_SYS_DELAY_US_TIMER htim6 // US延时定时器 #define PC_SYS_DELAY_US_TIMER htim6 // US延时定时器
#define PC_SYS_ZTICKET_TIMER TIM11 // 系统ticket定时器 #define PC_SYS_ZTICKET_TIMER TIM11 // 系统ticket定时器

24
usrc/subboards/subboard20_plate_clamp_case/pri_board.h

@ -30,18 +30,18 @@
#define TMC_MOTOR_SPI hspi1 #define TMC_MOTOR_SPI hspi1
/*********************************************************************************************************************** /***********************************************************************************************************************
* *
* *
***********************************************************************************************************************/ ***********************************************************************************************************************/
#define MOTOR1_CSN PA4 #define MOTOR1_CSN PA4
#define MOTOR1_ENN PE3
#define MOTOR1_ENN PD5
#define MOTOR1_SPI_MODE_SELECT PinNull #define MOTOR1_SPI_MODE_SELECT PinNull
#define MOTOR1_nFREEZE_IO PE12
#define MOTOR1_nFREEZE_IO PinNull
#define MOTOR1_nRESET_IO PinNull #define MOTOR1_nRESET_IO PinNull
#define MOTOR1_SUB_IC_ENN_IO PE11
#define MOTOR1_SUB_IC_ENN_IO PinNull
#define MOTOR1_REFL PD2
#define MOTOR1_REFR PD1
#define MOTOR1_REFL PD0
#define MOTOR1_REFR PD8
#define MOTOR1_REFL_MIRROR true #define MOTOR1_REFL_MIRROR true
#define MOTOR1_REFR_MIRROR true #define MOTOR1_REFR_MIRROR true
@ -63,18 +63,18 @@
#define MOTOR1_MOTOR_LOOK_ZERO_EDGE_DEC 600 #define MOTOR1_MOTOR_LOOK_ZERO_EDGE_DEC 600
/*********************************************************************************************************************** /***********************************************************************************************************************
* *
* *
***********************************************************************************************************************/ ***********************************************************************************************************************/
#define MOTOR2_CSN PA4
#define MOTOR2_ENN PE3
#define MOTOR2_CSN PB1
#define MOTOR2_ENN PD4
#define MOTOR2_SPI_MODE_SELECT PinNull #define MOTOR2_SPI_MODE_SELECT PinNull
#define MOTOR2_nFREEZE_IO PE12
#define MOTOR2_nFREEZE_IO PinNull
#define MOTOR2_nRESET_IO PinNull #define MOTOR2_nRESET_IO PinNull
#define MOTOR2_SUB_IC_ENN_IO PE11
#define MOTOR2_SUB_IC_ENN_IO PinNull
#define MOTOR2_REFL PD2 #define MOTOR2_REFL PD2
#define MOTOR2_REFR PD1
#define MOTOR2_REFR PD9
#define MOTOR2_REFL_MIRROR true #define MOTOR2_REFL_MIRROR true
#define MOTOR2_REFR_MIRROR true #define MOTOR2_REFR_MIRROR true

Loading…
Cancel
Save