mirror of
https://github.com/modelec/MarcelMoteurSTM32.git
synced 2026-01-18 16:47:23 +01:00
fix: build issues
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
|
||||
#include "functions.h"
|
||||
#include "motors.h"
|
||||
#include "encoder.h"
|
||||
|
||||
extern Encoder encoder1;
|
||||
|
||||
|
||||
uint32_t lastTick = 0; // Variable pour mémoriser l'heure de la dernière action
|
||||
@@ -25,9 +28,12 @@ void Cpploop(Motor *motor){
|
||||
|
||||
//On actualise toute les 10ms et on effectue tous les controles périodiques
|
||||
if(isDelayPassed(10)) {
|
||||
|
||||
if(encoder1.getTotalDistance() > 10) {
|
||||
motor->stop();
|
||||
}
|
||||
//On met à jour le statut des moteurs
|
||||
motor->update();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ int main(void) {
|
||||
Motor motor(TIM3);
|
||||
|
||||
//On fait accélérer les moteurs
|
||||
//motor.accelerer(626);
|
||||
motor.accelerer(300);
|
||||
|
||||
/* USER CODE END 2 */
|
||||
|
||||
@@ -127,7 +127,7 @@ int main(void) {
|
||||
|
||||
/* USER CODE BEGIN 3 */
|
||||
|
||||
//Cpploop(&motor);
|
||||
Cpploop(&motor);
|
||||
|
||||
}
|
||||
/* USER CODE END 3 */
|
||||
|
||||
@@ -48,7 +48,7 @@ defined in linker script */
|
||||
.weak Reset_Handler
|
||||
.type Reset_Handler, %function
|
||||
Reset_Handler:
|
||||
ldr r0, =_estack
|
||||
ldr r0, =_estack
|
||||
mov sp, r0 /* set stack pointer */
|
||||
|
||||
/* Call the clock system initialization function.*/
|
||||
|
||||
Reference in New Issue
Block a user