mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-23 09:03:40 +08:00
writespi bug found, response still all 0
This commit is contained in:
@@ -583,7 +583,7 @@ void DRV8301_writeSpi(DRV8301_Handle handle, const DRV8301_RegName_e regName,con
|
||||
osDelay(1);
|
||||
|
||||
// Do blocking write
|
||||
uint16_t controlword = (uint16_t)DRV8301_buildCtrlWord(DRV8301_CtrlMode_Write, regName, 0);
|
||||
uint16_t controlword = (uint16_t)DRV8301_buildCtrlWord(DRV8301_CtrlMode_Write, regName, data);
|
||||
HAL_SPI_Transmit(handle->spiHandle, (uint8_t*)(&controlword), 1, 1000);
|
||||
osDelay(1);
|
||||
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ CAN1.CalculateTimeQuantum=380.95238095238096
|
||||
CAN1.IPParameters=CalculateTimeQuantum,CalculateTimeBit
|
||||
FREERTOS.INCLUDE_vTaskDelayUntil=1
|
||||
FREERTOS.IPParameters=Tasks01,INCLUDE_vTaskDelayUntil
|
||||
FREERTOS.Tasks01=defaultTask,-3,128,StartDefaultTask,Default
|
||||
FREERTOS.Tasks01=defaultTask,-3,256,StartDefaultTask,Default
|
||||
File.Version=6
|
||||
KeepUserPlacement=false
|
||||
Mcu.Family=STM32F4
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ void MX_FREERTOS_Init(void) {
|
||||
|
||||
/* Create the thread(s) */
|
||||
/* definition and creation of defaultTask */
|
||||
osThreadDef(defaultTask, StartDefaultTask, osPriorityIdle, 0, 128);
|
||||
osThreadDef(defaultTask, StartDefaultTask, osPriorityIdle, 0, 256);
|
||||
defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
|
||||
|
||||
/* USER CODE BEGIN RTOS_THREADS */
|
||||
|
||||
+3
-1
@@ -91,10 +91,12 @@ void test_DRV8301_setup() {
|
||||
//The DRV_8301 driver instance
|
||||
//DRV8301_Obj gate_drivers[NUM_MOTORS];
|
||||
|
||||
while(1){
|
||||
for (int i = 0; i < num_motors; ++i) {
|
||||
DRV8301_enable(&gate_drivers[i]);
|
||||
DRV8301_setupSpi(&gate_drivers[i], &gate_driver_regs[i]);
|
||||
osDelay(1);
|
||||
osDelay(1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user