From 04258366428601e29c39843887d5c27103fe9387 Mon Sep 17 00:00:00 2001 From: "A.M. Rowsell" Date: Tue, 30 Jun 2026 06:21:52 -0400 Subject: [PATCH] chore: reorganize source organization to a more modern style --- CMakeLists.txt | 10 ++++++++-- {inc => include}/aht.h | 0 {inc => include}/bmp.h | 0 {inc => include}/ens.h | 0 {inc => include}/lwipopts.h | 0 {inc => include}/mbedtls_config.h | 0 {inc => include}/mqtt.h | 0 aht.c => src/aht.c | 2 +- bmp.c => src/bmp.c | 2 +- ens.c => src/ens.c | 2 +- main.c => src/main.c | 8 ++++---- mqtt.c => src/mqtt.c | 2 +- 12 files changed, 16 insertions(+), 10 deletions(-) rename {inc => include}/aht.h (100%) rename {inc => include}/bmp.h (100%) rename {inc => include}/ens.h (100%) rename {inc => include}/lwipopts.h (100%) rename {inc => include}/mbedtls_config.h (100%) rename {inc => include}/mqtt.h (100%) rename aht.c => src/aht.c (97%) rename bmp.c => src/bmp.c (99%) rename ens.c => src/ens.c (98%) rename main.c => src/main.c (98%) rename mqtt.c => src/mqtt.c (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 931d735..a460633 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,12 +24,18 @@ project(ensaht C CXX ASM) # Add executable. Default name is the project name, version 0.1 -add_executable(ensaht main.c mqtt.c bmp.c aht.c ens.c) +add_executable(ensaht + src/main.c + src/mqtt.c + src/bmp.c + src/aht.c + src/ens.c +) # Add the standard include files to the build target_include_directories(ensaht PRIVATE ${CMAKE_CURRENT_LIST_DIR} - ${CMAKE_CURRENT_LIST_DIR}/inc + ${CMAKE_CURRENT_LIST_DIR}/include ${CMAKE_CURRENT_LIST_DIR}/.. # for our common lwipopts or any other standard includes, if required ) pico_set_program_name(ensaht "ensaht") diff --git a/inc/aht.h b/include/aht.h similarity index 100% rename from inc/aht.h rename to include/aht.h diff --git a/inc/bmp.h b/include/bmp.h similarity index 100% rename from inc/bmp.h rename to include/bmp.h diff --git a/inc/ens.h b/include/ens.h similarity index 100% rename from inc/ens.h rename to include/ens.h diff --git a/inc/lwipopts.h b/include/lwipopts.h similarity index 100% rename from inc/lwipopts.h rename to include/lwipopts.h diff --git a/inc/mbedtls_config.h b/include/mbedtls_config.h similarity index 100% rename from inc/mbedtls_config.h rename to include/mbedtls_config.h diff --git a/inc/mqtt.h b/include/mqtt.h similarity index 100% rename from inc/mqtt.h rename to include/mqtt.h diff --git a/aht.c b/src/aht.c similarity index 97% rename from aht.c rename to src/aht.c index db41204..08e4009 100644 --- a/aht.c +++ b/src/aht.c @@ -1,4 +1,4 @@ -#include "inc/aht.h" +#include "aht.h" #include "hardware/i2c.h" #include "pico/stdlib.h" // IWYU pragma: keep diff --git a/bmp.c b/src/bmp.c similarity index 99% rename from bmp.c rename to src/bmp.c index 78fd325..fce8a1f 100644 --- a/bmp.c +++ b/src/bmp.c @@ -1,6 +1,6 @@ // Copyright 2026 A.M. Rowsell // SPDX-License-Identifier: MIT -#include "inc/bmp.h" +#include "bmp.h" float bmp_cal_data_fp[15]; diff --git a/ens.c b/src/ens.c similarity index 98% rename from ens.c rename to src/ens.c index 0070334..3d6fc96 100644 --- a/ens.c +++ b/src/ens.c @@ -1,4 +1,4 @@ -#include "inc/ens.h" +#include "ens.h" #include "hardware/i2c.h" #include "pico/stdlib.h" // IWYU pragma: keep diff --git a/main.c b/src/main.c similarity index 98% rename from main.c rename to src/main.c index a875b0c..3eac4e3 100644 --- a/main.c +++ b/src/main.c @@ -18,10 +18,10 @@ * the readings to Adafruit IO over MQTT using the Pico W. ******************************************************************************/ -#include "inc/aht.h" -#include "inc/bmp.h" -#include "inc/ens.h" -#include "inc/mqtt.h" +#include "aht.h" +#include "bmp.h" +#include "ens.h" +#include "mqtt.h" #include "hardware/gpio.h" #include "hardware/i2c.h" #include "pico/cyw43_arch.h" diff --git a/mqtt.c b/src/mqtt.c similarity index 99% rename from mqtt.c rename to src/mqtt.c index bddcf0c..ff9c22e 100644 --- a/mqtt.c +++ b/src/mqtt.c @@ -1,4 +1,4 @@ -#include "inc/mqtt.h" +#include "mqtt.h" #include "lwip/altcp.h" // IWYU pragma: keep #include "lwip/altcp_tls.h"