Amélioration du build avec cmake
This commit is contained in:
parent
156e8258ba
commit
03b6c7c5bd
12
CMakeLists.txt
Normal file
12
CMakeLists.txt
Normal file
@ -0,0 +1,12 @@
|
||||
project(RP2040_Servomoteurs C)
|
||||
|
||||
include(../pico_sdk_import.cmake)
|
||||
|
||||
add_library(RP2040_Servomoteurs
|
||||
Servomoteur.c
|
||||
)
|
||||
|
||||
target_link_libraries(RP2040_Servomoteurs
|
||||
pico_stdlib
|
||||
hardware_pwm
|
||||
)
|
||||
11
Readme.md
11
Readme.md
@ -21,18 +21,15 @@ Ajouter le fichier nouvellement créé .gitmodules à votre projet.
|
||||
Configuration de la compilation
|
||||
-------------------------------
|
||||
|
||||
Dans le fichier CMakeLists.txt, ajouter le fichier Servomoteur.c
|
||||
Dans le fichier CMakeLists.txt, ajouter le dossier du sub module:
|
||||
|
||||
add_executable(<MonProjet>
|
||||
...
|
||||
RP2040_Servomoteurs/Servomoteur.c
|
||||
)
|
||||
add_subdirectory(RP2040_Servomoteurs)
|
||||
|
||||
Dans le fichier CMakeLists.txt, ajouter la bibliothèque PWM :
|
||||
Dans le fichier CMakeLists.txt, ajouter la bibliothèque RP2040_Servomoteur :
|
||||
|
||||
target_link_libraries(Modele_RPiPico
|
||||
...
|
||||
hardware_pwm
|
||||
RP2040_Servomoteur
|
||||
)
|
||||
|
||||
Intégration au code source
|
||||
|
||||
@ -8,9 +8,12 @@
|
||||
#define SERVO_VALEUR_0_5MS 261
|
||||
|
||||
|
||||
// Servomoteurs
|
||||
// Nom des GPIOs des servomoteurs.
|
||||
// Ici, SERVO0 utilisera la GPIO 0 du RP2040
|
||||
#define SERVO0 0
|
||||
#define SERVO1 1
|
||||
|
||||
// Position prédéfinies
|
||||
#define DOIGT_AVANCE 0, SERVO_VALEUR_1_5MS
|
||||
#define DOIGT_RETRAIT 0, SERVO_VALEUR_0_5MS
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user