Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 10 additions & 6 deletions .devcontainer/devcontainer.json → .devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
{
"name": "Open PineBuds Pro - VS Code Development Environment",
"name": "OpenPineBuds - Dev Environment",
"build": {
"dockerfile": "../Dockerfile",
"context": ".."
},
"extensions": [
"ms-vscode.cmake-tools",
"ms-vscode.cpptools"
],
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cmake-tools",
"ms-vscode.cpptools"
]
}
},
"runArgs": [
"--privileged"
],
"userEnvProbe": "loginInteractiveShell",
"remoteUser": "root"
}
}
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
!.gitattributes
!.mailmap
!.github
!.devcontainer
!.devcontainer.json

# Backup files
*~
Expand Down Expand Up @@ -102,3 +102,8 @@ Release/
# *.ini
log.txt
log.txt

#CMake
/build/
CMakeCache.txt
/CMakeFiles/
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cmake_minimum_required (VERSION 3.12)
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
project (OpenPineBuds C CXX ASM)

option (OPB_BLUE_CONN_LIGHT "Enable the blue connection light" OFF) # Use BLE to control this.

set (CMAKE_EXPORT_COMPILE_COMMANDS ON)
set (CMAKE_CXX_STANDARD 14)
set (CMAKE_CXX_EXTENSIONS OFF)
set (CMAKE_CXX_STANDARD_REQUIRED ON)

add_subdirectory (src)
105 changes: 52 additions & 53 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,53 +1,52 @@
FROM debian:bullseye-slim AS base

FROM base AS rust_build

LABEL org.opencontainers.image.authors = "Ben V. Brown <ralim@ralimtek.com>, Dom Rodriguez <shymega@shymega.org.uk>"

WORKDIR /usr/src
ENV PATH="/root/.cargo/bin:$PATH"

RUN apt-get update \
&& apt-get install -y \
bc \
build-essential \
curl \
git \
libudev-dev \
pkg-config \
&& curl https://sh.rustup.rs -sSf | bash -s -- -y \
&& git clone https://github.com/Ralim/bestool.git \
&& cd /usr/src/bestool/bestool/ \
&& cargo build --release

FROM base as dev_env

WORKDIR /usr/src

RUN apt-get update \
&& apt-get install -y \
bash \
bc \
bzip2 \
curl \
ffmpeg \
clang-format \
git \
make \
tar \
xxd \
&& git config --global --add safe.directory /src \
&& mkdir -pv /src \
&& curl \
https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-$(arch)-linux.tar.bz2 | tar -xj -C /src/

RUN apt-get update \
&& apt-get install -y \
minicom \
sudo

ENV PATH="${PATH}:/src/gcc-arm-none-eabi-9-2019-q4-major/bin"
COPY --from=rust_build /usr/src/bestool/bestool/target/release/bestool /usr/local/bin/bestool
COPY . /usr/src

ENTRYPOINT ["/bin/bash"]
FROM debian:bullseye-slim AS base

FROM base AS rust_build

LABEL org.opencontainers.image.authors = "Ben V. Brown <ralim@ralimtek.com>, Dom Rodriguez <shymega@shymega.org.uk>"

WORKDIR /usr/src
ENV PATH="/root/.cargo/bin:$PATH"

RUN apt-get update \
&& apt-get install -y \
bc \
build-essential \
curl \
git \
libudev-dev \
pkg-config \
&& curl https://sh.rustup.rs -sSf | bash -s -- -y \
&& git clone https://github.com/Ralim/bestool.git \
&& cd /usr/src/bestool/bestool/ \
&& cargo build --release

FROM base as dev_env

WORKDIR /usr/src

RUN apt-get update \
&& apt-get install -y \
bash \
bc \
bzip2 \
clang-format \
cmake \
curl \
ffmpeg \
git \
make \
minicom \
sudo \
tar \
xxd \
&& git config --global --add safe.directory /usr/src \
&& mkdir -pv /usr/local/toolchains \
&& curl \
https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-$(arch)-linux.tar.bz2 \
| tar -xj -C /usr/local/toolchains

ENV PATH="${PATH}:/usr/local/toolchains/gcc-arm-none-eabi-9-2019-q4-major/bin"
COPY --from=rust_build /usr/src/bestool/bestool/target/release/bestool /usr/local/bin/bestool
COPY . /usr/src

ENTRYPOINT ["/bin/bash"]
File renamed without changes.
12 changes: 12 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set(CHIP best2300p)
set(CHIP_BEST2300P 1)
set(CHIP_ID_LITERAL best2300p)

add_compile_definitions(CHIP=${CHIP} CHIP_BEST2300P=${CHIP_BEST2300P} CHIP_ID_LITERAL=${CHIP_ID_LITERAL})

add_subdirectory(apps)
add_subdirectory(utils)
add_subdirectory(platform)
add_subdirectory(rtos)

include_directories (include)
File renamed without changes.
9 changes: 9 additions & 0 deletions src/apps/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
add_subdirectory (anc)
add_subdirectory (apptester)
add_subdirectory (audioplayers)
add_subdirectory (battery)
add_subdirectory (cmd)
add_subdirectory (common)
add_subdirectory (key)
add_subdirectory (main)

File renamed without changes.
12 changes: 12 additions & 0 deletions src/apps/anc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set (sources "./src/anc_wnr.c"
"./src/app_anc.c"
"./src/anc_assist.c"
"./src/peak_detector.c")

set (headers "./inc/anc_wnr.h"
"./inc/app_anc.h"
"./inc/anc_assist.h"
"./inc/peak_detector.h")

add_library (apps_anc STATIC ${sources} ${headers})
target_link_libraries (apps_anc PUBLIC apps_common)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions src/apps/apptester/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
file (GLOB headers "*.h")
file (GLOB sources "*.c*")

add_library (apps_apptester STATIC ${sources} ${headers})
target_link_libraries(apps_apptester apps_common)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions src/apps/audioplayers/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
add_subdirectory (a2dp_decoder)
add_subdirectory (rbplay)

file (GLOB headers "*.h")
file (GLOB sources "*.c*")

add_library (apps_audioplayers STATIC ${sources} ${headers})
target_link_libraries(apps_audioplayers util_list)
File renamed without changes.
5 changes: 5 additions & 0 deletions src/apps/audioplayers/a2dp_decoder/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
file (GLOB headers "*.h")
file (GLOB sources "*.c*")

add_library (apps_audioplayers_a2dpdecoder STATIC ${sources} ${headers})
target_link_libraries(apps_audioplayers_a2dpdecoder util_list)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions src/apps/audioplayers/rbplay/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
file (GLOB headers "*.h")
file (GLOB sources "*.cpp")

add_library (apps_audioplayers_rbplay STATIC ${sources} ${headers})
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions src/apps/battery/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
file (GLOB headers "*.h")
file (GLOB sources "*.cpp")

add_library (apps_battery STATIC ${sources} ${headers})
target_link_libraries(apps_battery apps_main)
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions src/apps/cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
file (GLOB headers "*.h")
file (GLOB sources "*.cpp")

add_library (apps_cmd STATIC ${sources} ${headers})
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions src/apps/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
file (GLOB headers "*.h")
file (GLOB sources "*.c*")

add_library (apps_common STATIC ${sources} ${headers})
target_link_libraries(apps_common platform_hal platform_drivers_ana)
target_include_directories(apps_common PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(apps_common PRIVATE
${CMAKE_SOURCE_DIR}/services/ibrt_ui/inc/
${CMAKE_SOURCE_DIR}/services/ibrt_core/inc/
${CMAKE_SOURCE_DIR}/services/bt_app/
${CMAKE_SOURCE_DIR}/services/app_ai/inc/
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions src/apps/key/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
file (GLOB headers "*.h")
file (GLOB sources "*.cpp")

add_library (apps_key STATIC ${sources} ${headers})
target_link_libraries(apps_key platform_hal)
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions src/apps/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
file (GLOB headers "*.h")
file (GLOB sources "*.c*")

add_library (apps_main STATIC ${sources} ${headers})
target_link_libraries(apps_main platform_hal)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions src/apps/mic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
file (GLOB headers "*.h")
file (GLOB sources "*.cpp")

add_library (apps_mic STATIC ${sources} ${headers})
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions src/apps/mic_alg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
file (GLOB headers "*.h")
file (GLOB sources "*.cpp")

add_library (apps_mic_alg STATIC ${sources} ${headers})
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions src/apps/pwl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
file (GLOB headers "*.h")
file (GLOB sources "*.cpp")

add_library (apps_pwl STATIC ${sources} ${headers})
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions src/apps/voice_detector/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
file (GLOB headers "*.h")
file (GLOB sources "*.c*")

add_library (apps_voice_detector STATIC ${sources} ${headers})
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions src/platform/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
add_subdirectory(cmsis)
add_subdirectory(drivers)
add_subdirectory(hal)
#add_subdirectory(main)
File renamed without changes.
16 changes: 16 additions & 0 deletions src/platform/cmsis/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
file (GLOB headers "inc/*.h" "inc/ca/*.h" "*.h")
file (GLOB sources "ca/*.c" "ca/*.S" "*.c*")

add_compile_definitions(USAGE_FAULT=1 BUS_FAULT=1 MEM_FAULT=1)

if(DSP_LIB)
add_subdirectory(DSP_Lib)
endif(DSP_LIB)

add_library (platform_cmsis STATIC ${sources} ${headers})
set_property(TARGET platform_cmsis APPEND PROPERTY COMPILE_OPTIONS "-x" "assembler-with-cpp")
target_link_libraries(platform_cmsis platform_drivers_ana platform_drivers_codec platform_drivers_norflash)
target_include_directories(platform_cmsis PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/inc/ca/
${CMAKE_CURRENT_SOURCE_DIR}/inc/
)
Loading