-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
717 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ Check out the [Dispensy documentation](https://drinkrobotics.github.io/dispensy/ | |
|
||
## License | ||
|
||
This project is licensed under the [CERN Open Hardware Licence Version 2 - Strongly Reciprocal (CERN-OHL-S-2.0+)](https://ohwr.org/cern_ohl_s_v2.txt) or any later version. | ||
This hardware of this project is licensed under the [CERN Open Hardware Licence Version 2 - Strongly Reciprocal (CERN-OHL-S-2.0+)](https://ohwr.org/cern_ohl_s_v2.txt) or any later version. | ||
|
||
The docs are built using [mdbook](https://github.com/rust-lang/mdBook), licensed as `MPL-2.0`. | ||
The PCB SVG files in the documentation are displayed using [svg-pan-zoom](https://github.com/bumbu/svg-pan-zoom), licensed as `BSD-2-Clause`. | ||
|
@@ -41,7 +41,19 @@ Please also take a look at the `README.md` files in the subfolders of this proje | |
| source. | | ||
------------------------------------------------------------------------------ | ||
|
||
This is the SPDX header for this project: | ||
The firmware of this project is licensed as GPLv3. | ||
I initially adapted it from my own [Trackball](https://git.xythobuz.de/thomas/Trackball) and [Volcano Remote](https://git.xythobuz.de/thomas/sb-py) projects. | ||
It uses the [Pi Pico SDK](https://github.com/raspberrypi/pico-sdk), licensed as BSD 3-clause, and therefore also [TinyUSB](https://github.com/hathach/tinyusb), licensed under the MIT license. | ||
Some code is adapted from the TinyUSB examples. | ||
|
||
SPDX-FileCopyrightText: 2023 - 2024 Thomas Buck <[email protected]> | ||
SPDX-License-Identifier: CERN-OHL-S-2.0+ | ||
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. | ||
|
||
See <http://www.gnu.org/licenses/>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CompileFlags: | ||
Add: [-I/usr/arm-none-eabi/include] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* buttons.h | ||
* | ||
* Copyright (c) 2022 - 2023 Thomas Buck ([email protected]) | ||
* Copyright (c) 2022 - 2024 Thomas Buck ([email protected]) | ||
* | ||
* 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* config.h | ||
* | ||
* Copyright (c) 2022 - 2023 Thomas Buck ([email protected]) | ||
* Copyright (c) 2022 - 2024 Thomas Buck ([email protected]) | ||
* | ||
* 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 | ||
|
@@ -20,38 +20,14 @@ | |
#define __CONFIG_H__ | ||
|
||
#define APP_VERSION_MAJOR 0 | ||
#define APP_VERSION_MINOR 3 | ||
#define APP_VERSION_MINOR 1 | ||
|
||
#define MENU_PREFER_VOLCANO | ||
//#define MENU_PREFER_CRAFTY | ||
|
||
#define VOLCANO_AUTO_CONNECT_TIMEOUT_MS 2000 | ||
#define VOLCANO_AUTO_CONNECT_WITHIN_MS 10000 | ||
|
||
#define COUNTRY_CODE CYW43_COUNTRY_GERMANY | ||
|
||
#ifdef NDEBUG | ||
// Release build | ||
#define AUTO_MOUNT_MASS_STORAGE | ||
#define AUTO_LOG_ON_MASS_STORAGE | ||
#endif // NDEBUG | ||
|
||
#define WATCHDOG_PERIOD_MS 1000 | ||
#define FLASH_LOCK_TIMEOUT_MS 500 | ||
#define WATCHDOG_PERIOD_MS 10 | ||
|
||
// ASCII 0x18 = CAN (cancel) | ||
#define ENTER_BOOTLOADER_MAGIC 0x18 | ||
|
||
//#define DISABLE_CDC_DTR_CHECK | ||
#define DEBOUNCE_DELAY_MS 5 | ||
|
||
#define SERIAL_WRITES_BLOCK_WHEN_BUFFER_FULL | ||
|
||
// TODO needs to be the same as in pack_data.sh | ||
#define DISK_BLOCK_SIZE 512 | ||
#define DISK_BLOCK_COUNT (256 + 128) // 384 * 512 = 196608 | ||
|
||
#define TEST_VOLCANO_AUTO_CONNECT "EA:06:75:A7:D1:15 1" | ||
#define TEST_CRAFTY_AUTO_CONNECT "60:B6:E1:BB:61:36 0" | ||
|
||
#endif // __CONFIG_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* console.h | ||
* | ||
* Copyright (c) 2022 - 2023 Thomas Buck ([email protected]) | ||
* Copyright (c) 2022 - 2024 Thomas Buck ([email protected]) | ||
* | ||
* 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* lipo.h | ||
* | ||
* Copyright (c) 2023 Thomas Buck ([email protected]) | ||
* Copyright (c) 2023 - 2024 Thomas Buck ([email protected]) | ||
* | ||
* 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* log.h | ||
* | ||
* Copyright (c) 2022 - 2023 Thomas Buck ([email protected]) | ||
* Copyright (c) 2022 - 2024 Thomas Buck ([email protected]) | ||
* | ||
* 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 | ||
|
@@ -26,17 +26,11 @@ | |
|
||
// for output that is stored in the debug log. | ||
// will be re-played from buffer when terminal connects | ||
#ifndef PICOWOTA | ||
#define debug(fmt, ...) debug_log(true, \ | ||
"%08" PRIu32 " %s:%d: " fmt "\r\n", \ | ||
to_ms_since_boot(get_absolute_time()), \ | ||
__func__, __LINE__, \ | ||
##__VA_ARGS__) | ||
#else // PICOWOTA | ||
#define debug(fmt, ...) debug_log(true, \ | ||
fmt "\r\n", \ | ||
##__VA_ARGS__) | ||
#endif // PICOWOTA | ||
|
||
// for interactive output. is not stored or re-played. | ||
#define print(fmt, ...) debug_log(false, fmt, ##__VA_ARGS__) | ||
|
@@ -47,8 +41,6 @@ void debug_wait_input(const char *format, ...) __attribute__((format(printf, 1, | |
void debug_log_va(bool log, const char *format, va_list args); | ||
|
||
void log_dump_to_usb(void); | ||
void log_dump_to_uart(void); | ||
void log_dump_to_disk(void); | ||
|
||
void debug_handle_input(const void *buff, size_t len); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* main.h | ||
* | ||
* Copyright (c) 2023 Thomas Buck ([email protected]) | ||
* Copyright (c) 2023 - 2024 Thomas Buck ([email protected]) | ||
* | ||
* 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* ring.h | ||
* | ||
* Copyright (c) 2023 Thomas Buck ([email protected]) | ||
* Copyright (c) 2023 - 2024 Thomas Buck ([email protected]) | ||
* | ||
* 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* Extended from TinyUSB example code. | ||
* | ||
* Copyright (c) 2022 - 2023 Thomas Buck ([email protected]) | ||
* Copyright (c) 2022 - 2024 Thomas Buck ([email protected]) | ||
* | ||
* The MIT License (MIT) | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* usb.h | ||
* | ||
* Copyright (c) 2022 - 2023 Thomas Buck ([email protected]) | ||
* Copyright (c) 2022 - 2024 Thomas Buck ([email protected]) | ||
* | ||
* 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* usb_cdc.h | ||
* | ||
* Copyright (c) 2022 - 2023 Thomas Buck ([email protected]) | ||
* Copyright (c) 2022 - 2024 Thomas Buck ([email protected]) | ||
* | ||
* 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* usb_descriptors.h | ||
* | ||
* Copyright (c) 2022 - 2023 Thomas Buck ([email protected]) | ||
* Copyright (c) 2022 - 2024 Thomas Buck ([email protected]) | ||
* | ||
* 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* util.h | ||
* | ||
* Copyright (c) 2022 - 2023 Thomas Buck ([email protected]) | ||
* Copyright (c) 2022 - 2024 Thomas Buck ([email protected]) | ||
* | ||
* 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 | ||
|
@@ -19,11 +19,6 @@ | |
#ifndef __UTIL_H__ | ||
#define __UTIL_H__ | ||
|
||
void heartbeat_init(void); | ||
void heartbeat_run(void); | ||
|
||
int32_t convert_two_complement(int32_t b); | ||
|
||
bool str_startswith(const char *str, const char *start); | ||
|
||
void reset_to_bootloader(void); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* buttons.c | ||
* | ||
* Copyright (c) 2022 - 2023 Thomas Buck ([email protected]) | ||
* Copyright (c) 2022 - 2024 Thomas Buck ([email protected]) | ||
* | ||
* 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 | ||
|
@@ -16,8 +16,6 @@ | |
* See <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "pico/stdlib.h" | ||
|
||
#include "config.h" | ||
#include "log.h" | ||
#include "buttons.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* console.c | ||
* | ||
* Copyright (c) 2022 - 2023 Thomas Buck ([email protected]) | ||
* Copyright (c) 2022 - 2024 Thomas Buck ([email protected]) | ||
* | ||
* 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 | ||
|
@@ -21,9 +21,6 @@ | |
#include <unistd.h> | ||
#include <stdio.h> | ||
|
||
#include "pico/stdlib.h" | ||
#include "hardware/watchdog.h" | ||
|
||
#include "config.h" | ||
#include "log.h" | ||
#include "util.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* lcd.c | ||
* | ||
* Copyright (c) 2023 Thomas Buck ([email protected]) | ||
* Copyright (c) 2023 - 2024 Thomas Buck ([email protected]) | ||
* | ||
* 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 | ||
|
@@ -16,8 +16,6 @@ | |
* See <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "pico/stdlib.h" | ||
|
||
#include "config.h" | ||
#include "log.h" | ||
#include "lcd.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* log.c | ||
* | ||
* Copyright (c) 2022 - 2023 Thomas Buck ([email protected]) | ||
* Copyright (c) 2022 - 2024 Thomas Buck ([email protected]) | ||
* | ||
* 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 | ||
|
@@ -17,9 +17,6 @@ | |
*/ | ||
|
||
#include <stdio.h> | ||
#include <string.h> | ||
|
||
#include "hardware/watchdog.h" | ||
|
||
#include "config.h" | ||
#include "main.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* main.c | ||
* | ||
* Copyright (c) 2022 - 2023 Thomas Buck ([email protected]) | ||
* Copyright (c) 2022 - 2024 Thomas Buck ([email protected]) | ||
* | ||
* 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 | ||
|
@@ -16,11 +16,9 @@ | |
* See <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "pico/stdlib.h" | ||
#include "hardware/watchdog.h" | ||
|
||
#include "config.h" | ||
#include "util.h" | ||
#include "console.h" | ||
#include "log.h" | ||
#include "usb.h" | ||
|
@@ -31,7 +29,6 @@ | |
void main_loop_hw(void) { | ||
watchdog_update(); | ||
usb_run(); | ||
heartbeat_run(); | ||
} | ||
|
||
int main(void) { | ||
|
@@ -50,6 +47,7 @@ int main(void) { | |
} | ||
|
||
buttons_init(); | ||
lcd_init(); | ||
|
||
debug("go"); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* ring.c | ||
* | ||
* Copyright (c) 2023 Thomas Buck ([email protected]) | ||
* Copyright (c) 2023 - 2024 Thomas Buck ([email protected]) | ||
* | ||
* 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* Extended from TinyUSB example code. | ||
* | ||
* Copyright (c) 2022 - 2023 Thomas Buck ([email protected]) | ||
* Copyright (c) 2022 - 2024 Thomas Buck ([email protected]) | ||
* | ||
* The MIT License (MIT) | ||
* | ||
|
@@ -33,7 +33,6 @@ | |
#include "config.h" | ||
#include "log.h" | ||
#include "usb_descriptors.h" | ||
#include "usb_cdc.h" | ||
#include "usb.h" | ||
|
||
void usb_init(void) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* Extended from TinyUSB example code. | ||
* | ||
* Copyright (c) 2022 - 2023 Thomas Buck ([email protected]) | ||
* Copyright (c) 2022 - 2024 Thomas Buck ([email protected]) | ||
* | ||
* The MIT License (MIT) | ||
* | ||
|
Oops, something went wrong.