Skip to content

Commit

Permalink
Added init reset of CF-BL ESCs
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbeanton committed Apr 4, 2024
1 parent 1cf603d commit dbb09b5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/drivers/src/motors.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,13 @@ void motorsInit(const MotorPerifDef** motorMapSelect)

// Configure the GPIO for CF-BL ESC RST
GPIO_StructInit(&GPIO_InitStructure);
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_OD;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;
GPIO_Init(GPIOC, &GPIO_InitStructure);
// Hold reset for all CF-BL ESC:s by pulling low.
GPIO_WriteBit(GPIOC, GPIO_Pin_15, Bit_RESET);

// Configure the GPIO for the timer output
GPIO_StructInit(&GPIO_InitStructure);
Expand Down Expand Up @@ -293,6 +296,9 @@ void motorsInit(const MotorPerifDef** motorMapSelect)

// Output zero power
motorsStop();
// Release reset for all CF-BL ESC:s after motor signal is activated
GPIO_WriteBit(GPIOC, GPIO_Pin_15, Bit_SET);

}

void motorsDeInit(const MotorPerifDef** motorMapSelect)
Expand Down

0 comments on commit dbb09b5

Please sign in to comment.