diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..a3270f6 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +has nix && use nix diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..97478eb --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "lib/pico-sdk"] + path = lib/pico-sdk + url = https://github.com/raspberrypi/pico-sdk diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..52e8fef --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.13) + +set(PICO_SDK_PATH lib/pico-sdk) +include(lib/pico-sdk/external/pico_sdk_import.cmake) + +project(vibe-check) + +pico_sdk_init() + +add_executable(vibe-check + src/main.c +) + +# Add pico_stdlib library which aggregates commonly used features +target_link_libraries(vibe-check pico_stdlib) + +# create map/bin/hex/uf2 file in addition to ELF. +pico_add_extra_outputs(vibe-check) diff --git a/lib/pico-sdk b/lib/pico-sdk new file mode 160000 index 0000000..f396d05 --- /dev/null +++ b/lib/pico-sdk @@ -0,0 +1 @@ +Subproject commit f396d05f8252d4670d4ea05c8b7ac938ef0cd381 diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..f057545 --- /dev/null +++ b/shell.nix @@ -0,0 +1,6 @@ +{ pkgs ? import {} }: +pkgs.mkShell { + buildInputs = with pkgs; [ + cmake python3 gcc-arm-embedded + ]; +} diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..bd67fad --- /dev/null +++ b/src/main.c @@ -0,0 +1,8 @@ +#include +#include "pico/stdlib.h" + +int main() { + setup_default_uart(); + printf("Hello, world!\n"); + return 0; +}