From eec37c9bfe4f9efb275d2b1bb305472616029806 Mon Sep 17 00:00:00 2001 From: Samyar Sadat Akhavi Date: Sun, 25 Aug 2024 14:57:02 +0300 Subject: [PATCH] Added "_deps" to Pico build action ignore list, removed unused "systest" files. --- .github/workflows/pico-build.yml | 2 +- Source Code/pico_ws/src/CMakeLists.txt | 3 +- .../pico_ws/src/systest/CMakeLists.txt | 67 ---------- Source Code/pico_ws/src/systest/Pico.c++ | 122 ------------------ 4 files changed, 2 insertions(+), 192 deletions(-) delete mode 100644 Source Code/pico_ws/src/systest/CMakeLists.txt delete mode 100644 Source Code/pico_ws/src/systest/Pico.c++ diff --git a/.github/workflows/pico-build.yml b/.github/workflows/pico-build.yml index 159edb5..8367a95 100644 --- a/.github/workflows/pico-build.yml +++ b/.github/workflows/pico-build.yml @@ -95,7 +95,7 @@ jobs: source_dir: "Source Code/pico_ws" output_dir: "build" output_ext: "*.uf2 *.elf *.elf.map *.hex *.bin *.dis" - output_ignored_dirs: "src/lib" + output_ignored_dirs: "src/lib _deps" cmake_args: "-DCMAKE_BUILD_TYPE=Release" - name: Upload Pico Source Code Artifacts diff --git a/Source Code/pico_ws/src/CMakeLists.txt b/Source Code/pico_ws/src/CMakeLists.txt index 1a087d7..cc1844d 100644 --- a/Source Code/pico_ws/src/CMakeLists.txt +++ b/Source Code/pico_ws/src/CMakeLists.txt @@ -21,5 +21,4 @@ add_subdirectory(lib) # Pico firmware -add_subdirectory(pico) -#add_subdirectory(systest) \ No newline at end of file +add_subdirectory(pico) \ No newline at end of file diff --git a/Source Code/pico_ws/src/systest/CMakeLists.txt b/Source Code/pico_ws/src/systest/CMakeLists.txt deleted file mode 100644 index 138ef66..0000000 --- a/Source Code/pico_ws/src/systest/CMakeLists.txt +++ /dev/null @@ -1,67 +0,0 @@ -# The ROS remote project - Pico firmware CMake config -# (NOTE: THIS IS NOT THE TOP-LEVEL CMAKE FILE!) -# Copyright 2024 Samyar Sadat Akhavi -# Written by Samyar Sadat Akhavi, 2024. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - - -# ---- Pico ---- -message("Configuring Pico firmware build... (${PICO_NAME})") - -# Add source files -add_executable(${PICO_NAME} Pico.c++) - -# Create map/bin/hex/uf2 files -pico_add_extra_outputs(${PICO_NAME}) - -# Link to libraries -target_link_libraries(${PICO_NAME} pico_stdlib - hardware_pwm - hardware_adc - helpers_lib -) - -# Link to include directories -target_include_directories(${PICO_NAME} PUBLIC ${CMAKE_CURRENT_LIST_DIR}) - -# Target-specific compile definitions -target_compile_definitions(${PICO_NAME} PRIVATE - PICO_RP2040_B0_SUPPORTED=0 - PICO_STACK_SIZE=0x1000 - PICO_USE_STACK_GUARDS=1 - PICO_DEFAULT_UART=1 - PICO_DEFAULT_UART_TX_PIN=8 - PICO_DEFAULT_UART_RX_PIN=9 -) - -# PicoTool binary information -pico_set_program_name(${PICO_NAME} ${PICO_NAME}) -pico_set_program_version(${PICO_NAME} ${PROJECT_VERSION}) -pico_set_program_description(${PICO_NAME} "The ROS Remote Project - Main Pico Firmware") - -# Enable STDIO over USB and UART -pico_enable_stdio_usb(${PICO_NAME} 1) -pico_enable_stdio_uart(${PICO_NAME} 1) - -# CMake flags -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections") - -# Compile definitions & options -add_compile_definitions(PICO_UART_ENABLE_CRLF_SUPPORT=0) -add_compile_definitions(PICO_STDIO_ENABLE_CRLF_SUPPORT=0) -add_compile_definitions(PICO_STDIO_DEFAULT_CRLF=0) -add_compile_options(-Wall -Wextra -Wpedantic) \ No newline at end of file diff --git a/Source Code/pico_ws/src/systest/Pico.c++ b/Source Code/pico_ws/src/systest/Pico.c++ deleted file mode 100644 index 7b6e2f1..0000000 --- a/Source Code/pico_ws/src/systest/Pico.c++ +++ /dev/null @@ -1,122 +0,0 @@ -/* - The ROS remote project - Raspberry Pi Pico firmware - Copyright 2024 Samyar Sadat Akhavi - Written by Samyar Sadat Akhavi, 2024. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "helpers_lib/Helpers.h" -#include "hardware/adc.h" - - -int main() -{ - stdio_init_all(); - adc_init(); - - init_pin(0, OUTPUT_PWM); - init_pin(1, OUTPUT_PWM); - init_pin(2, OUTPUT_PWM); - - init_pin(3, INPUT_PULLUP); - init_pin(4, INPUT_PULLUP); - init_pin(5, INPUT_PULLUP); - init_pin(6, INPUT_PULLUP); - init_pin(7, INPUT_PULLUP); - - init_pin(8, OUTPUT_PWM); - init_pin(9, OUTPUT_PWM); - init_pin(10, OUTPUT_PWM); - init_pin(11, OUTPUT_PWM); - init_pin(12, OUTPUT_PWM); - init_pin(13, OUTPUT_PWM); - init_pin(14, OUTPUT_PWM); - init_pin(15, OUTPUT_PWM); - - init_pin(18, INPUT_PULLUP); - init_pin(19, INPUT_PULLUP); - init_pin(20, INPUT_PULLUP); - init_pin(21, INPUT_PULLUP); - init_pin(22, INPUT_PULLUP); - - init_pin(26, INPUT_ADC); - init_pin(27, INPUT_ADC); - init_pin(28, INPUT_ADC); - - init_pin(23, OUTPUT); - gpio_put(23, HIGH); - - /*while (true) - { - for (int i = 0; i < 16; i++) - { - if (i == 3) - { - i = 8; - } - - gpio_put_pwm(i, 65535); - sleep_ms(100); - } - - for (int i = 0; i < 16; i++) - { - if (i == 3) - { - i = 8; - } - - gpio_put_pwm(i, 0); - sleep_ms(100); - } - }*/ - - for (int i = 0; i < 16; i++) - { - if (i == 3) - { - i = 8; - } - - gpio_put_pwm(i, 65535); - sleep_ms(250); - } - - while (true) - { - // ADC - adc_select_input(0); - sleep_ms(1); - float adc0 = adc_read(); - - adc_select_input(1); - sleep_ms(1); - float adc1 = adc_read(); - - adc_select_input(2); - sleep_ms(1); - float adc2 = adc_read(); - - printf("A0: %.2f, A1: %.2f, A2: %.2f\r\n", adc0, adc1, adc2); - - // DIGITAL - //printf("D3 %i, D4 %i, D5 %i, D6 %i, D7 %i, D18 %i, D19 %i, D20 %i, D21 %i, D22 %i\r\n", gpio_get(3), gpio_get(4), gpio_get(5), - // gpio_get(6), gpio_get(7), gpio_get(18), - // gpio_get(19), gpio_get(20), gpio_get(21), - // gpio_get(22)); - } - - return 0; -} \ No newline at end of file