Skip to content

Commit

Permalink
Final changes before release 1.0.0
Browse files Browse the repository at this point in the history
- Fix piogen.py and regenerate platform.ini
- Introduce an inline API for gpio drivers named "gpiol".
- Add sample to be used with a button
- Introduce CONFIG_KERNEL_SILENT_FAULTS
- Introduce __fault_hook for debug purposes
- Add samples for Arduino
- Introduce function serial_init_baud()
- Introduce led_get()
- Introduce k_thread_set_priority()
- Introduce CONFIG_SERIAL_USART_BAUDRATE
- Add script to automatically generate Arduino samples for PIO ones
- Add philosopher example for arduino
- Add guards to prevent user to call k_yield_* from k_event or k_timer handlers.
- Add CONFIG_KERNEL_SYSCLOCK_PERIOD_US and CONFIG_KERNEL_TIME_SLICE_US to arduino configuration
- Add support for GPIO debug of kernel
- Introduce new asserts
- Shorten assertion failed message
- Update readme.md
- Remove .editorconfig
- Improve Makefile
- Add requirements.txt
- Remove old arduino sample
  • Loading branch information
lucasdietrich committed Mar 25, 2023
1 parent 49e2821 commit dcf7dec
Show file tree
Hide file tree
Showing 67 changed files with 2,439 additions and 687 deletions.
4 changes: 3 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ IndentWidth: 8
UseTab: Always
WhitespaceSensitiveMacros:
- STRINGIFY
- Z_STRINGIFY
- Z_STRINGIFY
AccessModifierOffset: -8
IndentAccessModifiers: false
67 changes: 0 additions & 67 deletions .editorconfig

This file was deleted.

10 changes: 3 additions & 7 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"ms-vscode.cmake-tools",
"twxs.cmake",
"rockcat.avr-support",
"mitaki28.vscode-clang",
"ms-vscode.cpptools-extension-pack",
],
"unwantedRecommendations": [
"ms-vscode.cpptools",
"platformio.platformio-ide",
]
],
}
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
},
"files.associations": {
"*.asm": "avr",
"*.bb": "shellscript",
"*.bbclass": "shellscript",
"*.inc": "shellscript",
"multithreading_debug.h": "c",
"serial.h": "c",
"multithreading.h": "c",
Expand Down Expand Up @@ -55,7 +58,8 @@
"logging.h": "c",
"iom2560.h": "c",
"iomxx0_1.h": "c",
"typeinfo": "c"
"typeinfo": "c",
"exti.h": "c"
},
"editor.rulers": [80]
}
50 changes: 34 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,57 @@
# GENERATOR="Ninja"
# GENERATOR_COMMAND="ninja"
# GENERATOR_ARGS=""
GENERATOR="Unix Makefiles"
GENERATOR_COMMAND="make"
GENERATOR_ARGS="--no-print-directory"
GENERATOR?="Unix Makefiles"
GENERATOR_COMMAND?="make"
GENERATOR_ARGS?="--no-print-directory"


DEVICE=/dev/ttyACM0
SINGLE_SAMPLE=shell
TOOLCHAIN_FILE=cmake/avr6-atmega2560.cmake
BAUDRATE=500000
QEMU=OFF
DEVICE?=/dev/ttyACM0
SINGLE_SAMPLE?=shell
TOOLCHAIN_FILE?=cmake/avr6-atmega2560.cmake
BAUDRATE?=500000
QEMU?=OFF

# if QEMU is enabled, set CMAKE_BUILD_TYPE to Debug
ifeq ($(QEMU),ON)
CMAKE_BUILD_TYPE?=Debug
else
CMAKE_BUILD_TYPE?=Release
endif

all: single

.PHONY: single cmake

cmake:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug \
cmake -S . -B build \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_TOOLCHAIN_FILE=$(TOOLCHAIN_FILE) \
-DCMAKE_GENERATOR=$(GENERATOR) \
-DPROG_DEV=$(DEVICE) \
-DQEMU=$(QEMU)
-DQEMU=$(QEMU) \
-DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)

multiple:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug \
cmake -S . -B build \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_TOOLCHAIN_FILE=$(TOOLCHAIN_FILE) \
-DCMAKE_GENERATOR=$(GENERATOR) \
-DPROG_DEV=$(DEVICE) \
-DQEMU=$(QEMU)
-DQEMU=$(QEMU) \
-DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
$(GENERATOR_COMMAND) -C build $(GENERATOR_ARGS)

single:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug \
cmake -S . -B build \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_TOOLCHAIN_FILE=$(TOOLCHAIN_FILE) \
-DCMAKE_GENERATOR=$(GENERATOR) \
-DENABLE_SINGLE_SAMPLE=$(SINGLE_SAMPLE) \
-DPROG_DEV=$(DEVICE) \
-DQEMU=$(QEMU)
$(GENERATOR_COMMAND) -C build $(GENERATOC_ARGS)
-DQEMU=$(QEMU) \
-DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
$(GENERATOR_COMMAND) -C build $(GENERATOR_ARGS)

upload:
$(GENERATOR_COMMAND) -C build upload $(GENERATOR_ARGS)
Expand All @@ -55,4 +65,12 @@ format:
find src -iname *.h -o -iname *.c -o -iname *.cpp | xargs clang-format -i

clean:
rm -rf build
rm -rf build

piogen:
python3 ./scripts/piogen.py

arduinogen:
python3 ./scripts/arduinogen.py

gen: format piogen arduinogen
8 changes: 5 additions & 3 deletions examples/ArduinoBlinkingLed/ArduinoBlinkingLed.ino
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Lucas Dietrich <[email protected]>
* Copyright (c) 2023 Lucas Dietrich <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -10,11 +10,13 @@

void setup(void)
{
led_init();
pinMode(LED_BUILTIN, OUTPUT);
}

void loop(void)
{
led_toggle();
digitalWrite(LED_BUILTIN, HIGH);
k_sleep(K_MSEC(200u));
digitalWrite(LED_BUILTIN, LOW);
k_sleep(K_MSEC(200u));
}
Loading

0 comments on commit dcf7dec

Please sign in to comment.