summaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorAbel Tim <git@abeltim.com>2025-06-04 11:48:33 +0200
committerAbel Tim <git@abeltim.com>2025-06-04 11:48:33 +0200
commit4f8208af89e90338a20a1abad7293348dabc84cd (patch)
treeda96ffe0d41d5a6850335d28ebc1718731489d81 /code
parent8d8ba16aa4c60e5c5d83297f0213dd474c5057b4 (diff)
downloadrobotica-4f8208af89e90338a20a1abad7293348dabc84cd.tar.gz
robotica-4f8208af89e90338a20a1abad7293348dabc84cd.zip
multiple things
Signed-off-by: Abel Tim <git@abeltim.com>
Diffstat (limited to 'code')
-rw-r--r--code/main/teensy_player/CMakeLists.txt33
-rw-r--r--code/main/teensy_player/player.yaml34
-rw-r--r--code/main/teensy_player/prj.conf2
-rw-r--r--code/main/teensy_player/src/main.c11
4 files changed, 74 insertions, 6 deletions
diff --git a/code/main/teensy_player/CMakeLists.txt b/code/main/teensy_player/CMakeLists.txt
index 4de34fb..27e5715 100644
--- a/code/main/teensy_player/CMakeLists.txt
+++ b/code/main/teensy_player/CMakeLists.txt
@@ -2,6 +2,37 @@
cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
-project(blinky)
+project(
+ player
+ VERSION 1.0
+ DESCRIPTION "The code for the soccer player robot. https://github.com/mendelcollege-robotics/robotica"
+ LANGUAGES C
+)
+#[===[
+# Create a static library target named "my_lib"
+add_library(my_lib
+ STATIC
+ src/my_lib.c
+)
+target_include_directories(
+ my_lib
+ PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+)
+
+# Create an executable target with the same name as the project name
+add_executable(
+ ${PROJECT_NAME}
+ src/main.c
+)
+
+# Link the library to the executable. PRIVATE means that the library is not
+# exposed to targets that depend on this target.
+target_link_libraries(
+ ${PROJECT_NAME}
+ PRIVATE
+ my_lib
+)
+]===]
target_sources(app PRIVATE src/main.c)
diff --git a/code/main/teensy_player/player.yaml b/code/main/teensy_player/player.yaml
index de71191..df8f963 100644
--- a/code/main/teensy_player/player.yaml
+++ b/code/main/teensy_player/player.yaml
@@ -10,3 +10,37 @@ tests:
harness: led
integration_platforms:
- frdm_k64f
+
+manifest:
+ remotes:
+ # short names for project URLs
+ projects:
+ # a list of projects managed by west
+ defaults:
+ # default project attributes
+ self:
+ # configuration related to the manifest repository itself,
+ # i.e. the repository containing west.yml
+ version: "<schema-version>"
+ group-filter:
+ # a list of project groups to enable or disable
+ remotes:
+ - name: remote1
+ url-base: https://git.example.com/base1
+ - name: remote2
+ url-base: https://git.example.com/base2
+ projects:
+ - name: proj1
+ description: the first example project
+ remote: remote1
+ path: extra/project-1
+ - name: proj2
+ description: |
+ A multi-line description of the second example
+ project.
+ repo-path: my-path
+ remote: remote2
+ revision: v1.3
+ - name: proj3
+ url: https://github.com/user/project-three
+ revision: abcde413a111
diff --git a/code/main/teensy_player/prj.conf b/code/main/teensy_player/prj.conf
index 8f5b5f3..456b0fc 100644
--- a/code/main/teensy_player/prj.conf
+++ b/code/main/teensy_player/prj.conf
@@ -1,3 +1,5 @@
CONFIG_GPIO=y
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=y
CONFIG_PRINTK=y
+CONFIG_SERIAL=y
+CONFIG_UART_INTERRUPT_DRIVEN=y
diff --git a/code/main/teensy_player/src/main.c b/code/main/teensy_player/src/main.c
index e113c79..5b04ac2 100644
--- a/code/main/teensy_player/src/main.c
+++ b/code/main/teensy_player/src/main.c
@@ -3,16 +3,18 @@
#include <zephyr/drivers/gpio.h>
#include <zephyr/sys/printk.h>
#include <zephyr/sys/__assert.h>
+#include <zephyr/drivers/uart.h>
+#include <zephyr/drivers/pwm.h>
#include <string.h>
/* size of stack area used by each thread */
-#define STACKSIZE 1024
+#define GEN_THRESD_STACKSIZE 1024
/*the pinout configuration*/
/*https://docs.zephyrproject.org/latest/boards/pjrc/teensy4/doc/index.html*/
/*motors pins*/
-#define m1enA DT_ALIAS(GPIO2_10) /*pin 6*/
-#define m1enB DT_ALIAS(GPIO4_8) /*pin 5*/
+#define m1enA DT_ALIAS(GPIO2_10) /*pin 6*//*Motor 1 EN A*/
+#define m1enB DT_ALIAS(GPIO4_8) /*pin 5*//*Motor 1 EN B*/
#define m1pwm1 DT_ALIAS(GPIO4_6) /*pin 4*/
#define m1pwm2 DT_ALIAS(GPIO4_5) /*pin 3*/
/*encoder pins*/
@@ -43,9 +45,8 @@ void ENCO_ISR(void *encN){
}
-
void ENC_ISR_installer(void){
- /*sets up the interupts for the encoder at same priority, need to configure FIFO in case of simultanius call*/
+ /*sets up the interupts for the encoder at same priority, need to configure FIFO in case of simultaneous call*/
IRQ_CONNECT(m1encoA, ENC_ISR_PRIO, ENCO_ISR, '0', MY_IRQ_FLAGS);
IRQ_CONNECT(m1encoB, ENC_ISR_PRIO, ENCO_ISR, '1', MY_IRQ_FLAGS);
}