├── Firmware ├── audio │ ├── resources │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── characters.pyc │ │ ├── data │ │ │ ├── map.bin │ │ │ └── waves.bin │ │ ├── resources.pyc │ │ ├── waveforms.pyc │ │ ├── waveshapers.pyc │ │ ├── lookup_tables.pyc │ │ └── __pycache__ │ │ │ ├── characters.cpython-38.pyc │ │ │ ├── characters.cpython-39.pyc │ │ │ └── lookup_tables.cpython-38.pyc │ └── small_stmlib.h ├── nanopb │ ├── extra │ │ ├── bazel │ │ │ ├── BUILD.bazel │ │ │ ├── nanopb_workspace.bzl │ │ │ └── python_deps.bzl │ │ ├── requirements.txt │ │ ├── nanopb-config.cmake │ │ ├── nanopb-config-version.cmake.in │ │ └── poetry │ │ │ └── poetry_build.sh │ ├── spm_headers │ │ ├── nanopb │ │ │ ├── pb.h │ │ │ ├── pb_common.h │ │ │ ├── pb_decode.h │ │ │ └── pb_encode.h │ │ ├── pb.h │ │ ├── pb_common.h │ │ ├── pb_decode.h │ │ └── pb_encode.h │ ├── tests │ │ ├── site_scons │ │ │ └── platforms │ │ │ │ ├── __init__.py │ │ │ │ ├── avr │ │ │ │ └── __init__.py │ │ │ │ ├── mips │ │ │ │ ├── __init__.py │ │ │ │ └── mips.py │ │ │ │ ├── mipsel │ │ │ │ ├── __init__.py │ │ │ │ └── mipsel.py │ │ │ │ ├── riscv64 │ │ │ │ ├── __init__.py │ │ │ │ └── riscv64.py │ │ │ │ └── stm32 │ │ │ │ ├── __init__.py │ │ │ │ ├── run_test.sh │ │ │ │ └── stm32.py │ │ ├── generator_relative_paths │ │ │ ├── any.expected │ │ │ ├── test.expected │ │ │ ├── simple.expected │ │ │ ├── test.proto │ │ │ └── proto │ │ │ │ └── simple.proto │ │ ├── extensions │ │ │ ├── extensions.options │ │ │ ├── extensions.proto │ │ │ └── SConscript │ │ ├── regression │ │ │ ├── issue_610 │ │ │ │ ├── first.expected │ │ │ │ ├── LogMessage.proto │ │ │ │ ├── nanopb_generator_bug │ │ │ │ │ ├── first │ │ │ │ │ │ ├── a │ │ │ │ │ │ │ ├── aa.proto │ │ │ │ │ │ │ └── ab.proto │ │ │ │ │ │ ├── b │ │ │ │ │ │ │ └── ba.proto │ │ │ │ │ │ ├── b.proto │ │ │ │ │ │ └── a.proto │ │ │ │ │ └── first.proto │ │ │ │ └── DataPacket.proto │ │ │ ├── issue_195 │ │ │ │ ├── test.expected │ │ │ │ ├── test.proto │ │ │ │ └── SConscript │ │ │ ├── issue_380 │ │ │ │ ├── manglenames.options │ │ │ │ ├── SConscript │ │ │ │ └── manglenames.proto │ │ │ ├── issue_524 │ │ │ │ ├── oneof.expected │ │ │ │ ├── submessage.proto │ │ │ │ ├── oneof.proto │ │ │ │ └── SConscript │ │ │ ├── issue_783 │ │ │ │ ├── folder_A │ │ │ │ │ ├── file_A.options │ │ │ │ │ └── file_A.proto │ │ │ │ ├── folder_C │ │ │ │ │ └── file_C.proto │ │ │ │ ├── folder_B │ │ │ │ │ └── file_B.proto │ │ │ │ └── SConscript │ │ │ ├── issue_145 │ │ │ │ ├── comments.expected │ │ │ │ ├── comments.proto │ │ │ │ ├── comments.options │ │ │ │ └── SConscript │ │ │ ├── issue_172 │ │ │ │ ├── submessage │ │ │ │ │ ├── submessage.options │ │ │ │ │ └── submessage.proto │ │ │ │ ├── test.proto │ │ │ │ ├── msg_size.c │ │ │ │ └── SConscript │ │ │ ├── issue_485 │ │ │ │ ├── uint8.expected │ │ │ │ └── SConscript │ │ │ ├── issue_306 │ │ │ │ ├── large_extension.expected │ │ │ │ ├── large_extension.proto │ │ │ │ └── SConscript │ │ │ ├── issue_125 │ │ │ │ ├── extensionbug.expected │ │ │ │ ├── extensionbug.options │ │ │ │ ├── SConscript │ │ │ │ └── extensionbug.proto │ │ │ ├── issue_617 │ │ │ │ ├── oneof.options │ │ │ │ ├── SConscript │ │ │ │ ├── test_oneof.c │ │ │ │ └── oneof.proto │ │ │ ├── issue_637 │ │ │ │ ├── other.proto │ │ │ │ ├── test.c │ │ │ │ ├── SConscript │ │ │ │ └── oneof.proto │ │ │ ├── issue_376 │ │ │ │ ├── fixed_array.options │ │ │ │ ├── fixed_array.proto │ │ │ │ └── SConscript │ │ │ ├── issue_188 │ │ │ │ ├── SConscript │ │ │ │ └── oneof.proto │ │ │ ├── issue_395 │ │ │ │ ├── test.options │ │ │ │ ├── SConscript │ │ │ │ └── test.proto │ │ │ ├── issue_453 │ │ │ │ ├── test.proto │ │ │ │ ├── test.c │ │ │ │ └── SConscript │ │ │ ├── issue_611 │ │ │ │ ├── uenum.expected │ │ │ │ ├── SConscript │ │ │ │ └── uenum.proto │ │ │ ├── issue_338 │ │ │ │ └── SConscript │ │ │ ├── issue_795 │ │ │ │ ├── test2.proto │ │ │ │ ├── test3.proto │ │ │ │ ├── SConscript │ │ │ │ └── test.proto │ │ │ ├── issue_118 │ │ │ │ ├── enumuse.proto │ │ │ │ ├── enumdef.proto │ │ │ │ └── SConscript │ │ │ ├── issue_547 │ │ │ │ ├── test.proto │ │ │ │ ├── SConscript │ │ │ │ └── test.c │ │ │ ├── issue_692 │ │ │ │ ├── other.proto │ │ │ │ ├── test.c │ │ │ │ ├── SConscript │ │ │ │ └── oneof.proto │ │ │ ├── GHSA-gcx3-7m76-287p │ │ │ │ ├── test.proto │ │ │ │ └── SConscript │ │ │ ├── issue_253 │ │ │ │ ├── short_array.proto │ │ │ │ ├── SConscript │ │ │ │ └── short_array.c │ │ │ ├── issue_487 │ │ │ │ ├── SConscript │ │ │ │ └── test.proto │ │ │ ├── issue_535 │ │ │ │ ├── SConscript │ │ │ │ └── issue_535.proto │ │ │ ├── issue_203 │ │ │ │ ├── file1.proto │ │ │ │ ├── file2.proto │ │ │ │ └── SConscript │ │ │ ├── issue_472 │ │ │ │ ├── SConscript │ │ │ │ └── test.proto │ │ │ ├── issue_746 │ │ │ │ ├── SConscript │ │ │ │ └── test.proto │ │ │ ├── issue_227 │ │ │ │ ├── unaligned_uint64.proto │ │ │ │ ├── unaligned_uint64.c │ │ │ │ └── SConscript │ │ │ ├── issue_342 │ │ │ │ ├── extensions.proto │ │ │ │ └── SConscript │ │ │ ├── issue_644 │ │ │ │ ├── SConscript │ │ │ │ └── int64.proto │ │ │ ├── issue_545 │ │ │ │ ├── SConscript │ │ │ │ └── submsg_callback.proto │ │ │ ├── issue_569 │ │ │ │ ├── a.proto │ │ │ │ ├── b.proto │ │ │ │ └── SConscript │ │ │ ├── issue_493 │ │ │ │ ├── test.proto │ │ │ │ └── SConscript │ │ │ ├── issue_647 │ │ │ │ ├── repro.proto │ │ │ │ ├── SConscript │ │ │ │ └── repro.c │ │ │ ├── issue_229 │ │ │ │ ├── multiple_oneof.proto │ │ │ │ └── SConscript │ │ │ ├── issue_558 │ │ │ │ ├── mixed.proto │ │ │ │ └── SConscript │ │ │ ├── issue_141 │ │ │ │ ├── SConscript │ │ │ │ └── testproto.expected │ │ │ ├── issue_631 │ │ │ │ ├── SConscript │ │ │ │ ├── test.c │ │ │ │ └── submsg_callback.proto │ │ │ ├── issue_838 │ │ │ │ ├── SConscript │ │ │ │ ├── enum.proto │ │ │ │ └── enum_to_string.cxx │ │ │ ├── issue_249 │ │ │ │ ├── test.proto │ │ │ │ └── SConscript │ │ │ ├── issue_494 │ │ │ │ ├── oneof.proto │ │ │ │ ├── submessage.proto │ │ │ │ ├── oneof_size.cc │ │ │ │ └── SConscript │ │ │ ├── issue_247 │ │ │ │ ├── padding.proto │ │ │ │ ├── SConscript │ │ │ │ └── padding.c │ │ │ ├── issue_205 │ │ │ │ ├── size_corruption.proto │ │ │ │ ├── size_corruption.c │ │ │ │ └── SConscript │ │ │ ├── issue_259 │ │ │ │ ├── callback_pointer.proto │ │ │ │ ├── SConscript │ │ │ │ └── callback_pointer.c │ │ │ ├── issue_256 │ │ │ │ ├── submsg_array.proto │ │ │ │ └── SConscript │ │ │ ├── issue_363 │ │ │ │ ├── oneofmsg.proto │ │ │ │ └── SConscript │ │ │ ├── issue_544 │ │ │ │ ├── submsg_callback.proto │ │ │ │ └── SConscript │ │ │ ├── issue_407 │ │ │ │ ├── SConscript │ │ │ │ └── extensions.proto │ │ │ ├── issue_242 │ │ │ │ ├── zero_value.proto │ │ │ │ └── SConscript │ │ │ ├── issue_166 │ │ │ │ ├── enums.proto │ │ │ │ └── SConscript │ │ │ ├── issue_322 │ │ │ │ ├── SConscript │ │ │ │ └── defaults.proto │ │ │ ├── issue_504 │ │ │ │ ├── SConscript │ │ │ │ └── test.proto │ │ │ └── issue_522 │ │ │ │ ├── SConscript │ │ │ │ └── uenum.proto │ │ ├── multiple_files │ │ │ ├── multifile1.options │ │ │ ├── multifile2.proto │ │ │ ├── SConscript │ │ │ ├── subdir │ │ │ │ └── multifile2.proto │ │ │ └── multifile1.proto │ │ ├── fallback_type │ │ │ ├── fallback_type.options │ │ │ ├── fallback_type.expected │ │ │ ├── SConscript │ │ │ └── fallback_type.proto │ │ ├── backwards_compatibility │ │ │ ├── alltypes_legacy.options │ │ │ └── SConscript │ │ ├── sort_by_tag │ │ │ ├── sort_by_tag.options │ │ │ ├── SConscript │ │ │ └── sort_by_tag.proto │ │ ├── special_characters │ │ │ ├── specchars.expected │ │ │ ├── funny-proto+name has.characters.options │ │ │ ├── SConscript │ │ │ └── funny-proto+name has.characters.proto │ │ ├── inline │ │ │ ├── inline.expected │ │ │ ├── SConscript │ │ │ └── inline.proto │ │ ├── map │ │ │ ├── map.options │ │ │ ├── map.proto │ │ │ └── SConscript │ │ ├── fuzztest │ │ │ ├── corpus.zip │ │ │ ├── regressions.zip │ │ │ ├── alltypes_proto3_static.options │ │ │ ├── alltypes_callback.options │ │ │ ├── alltypes_proto3_pointer.options │ │ │ ├── alltypes_static.options │ │ │ ├── validation.h │ │ │ ├── alltypes_pointer.options │ │ │ └── flakystream.h │ │ ├── any_type │ │ │ ├── google │ │ │ │ └── protobuf │ │ │ │ │ └── any.options │ │ │ └── SConscript │ │ ├── enum_mapping │ │ │ ├── enum_mapping.expected │ │ │ ├── SConscript │ │ │ └── enum_mapping.proto │ │ ├── float_double_conversion │ │ │ ├── doublemsg.proto │ │ │ └── SConscript │ │ ├── decode_unittests │ │ │ └── SConscript │ │ ├── options │ │ │ ├── options_c.expected │ │ │ ├── proto3_options.expected │ │ │ ├── proto3_options.proto │ │ │ ├── SConscript │ │ │ ├── options_h.expected │ │ │ └── options.c │ │ ├── alltypes_proto3 │ │ │ └── alltypes.options │ │ ├── no_messages │ │ │ ├── no_messages.proto │ │ │ └── SConscript │ │ ├── stackusage │ │ │ ├── stackusage.options │ │ │ └── SConscript │ │ ├── common_unittests │ │ │ └── SConscript │ │ ├── message_sizes │ │ │ ├── dummy.c │ │ │ ├── messages2.proto │ │ │ ├── SConscript │ │ │ └── messages1.proto │ │ ├── without_64bit │ │ │ ├── alltypes.options │ │ │ └── no_64bit_syshdr.h │ │ ├── enum_to_string │ │ │ ├── SConscript │ │ │ ├── enum.proto │ │ │ └── enum_to_string.c │ │ ├── field_size_16_proto3 │ │ │ ├── alltypes.options │ │ │ └── SConscript │ │ ├── comments │ │ │ ├── SConscript │ │ │ └── comments.expected │ │ ├── encode_unittests │ │ │ └── SConscript │ │ ├── typename_mangling │ │ │ ├── with_package.options │ │ │ ├── test_strip_package.c │ │ │ ├── test_flatten.c │ │ │ └── test_package_initials.c │ │ ├── field_size_32 │ │ │ └── alltypes.options │ │ ├── enum_minmax │ │ │ ├── SConscript │ │ │ ├── enumminmax_unittests.c │ │ │ └── enumminmax.proto │ │ ├── field_size_16 │ │ │ └── alltypes.options │ │ ├── proto3_optional │ │ │ ├── optional.proto │ │ │ └── SConscript │ │ ├── cxx_descriptor │ │ │ └── message.proto │ │ ├── cyclic_messages │ │ │ ├── cyclic_callback.options │ │ │ ├── SConscript │ │ │ └── cyclic.proto │ │ ├── infinity_nan │ │ │ ├── SConscript │ │ │ └── floats.proto │ │ ├── docker_images │ │ │ ├── build_all.sh │ │ │ ├── README.md │ │ │ ├── ubuntu1804 │ │ │ │ └── Dockerfile │ │ │ └── ubuntu2004 │ │ │ │ └── Dockerfile │ │ ├── extra_fields │ │ │ └── person_with_extra_field.expected │ │ ├── alltypes │ │ │ └── alltypes.options │ │ ├── io_errors │ │ │ ├── alltypes.options │ │ │ └── SConscript │ │ ├── alltypes_proto3_callback │ │ │ └── alltypes.options │ │ ├── io_errors_pointers │ │ │ ├── alltypes.options │ │ │ └── SConscript │ │ ├── missing_fields │ │ │ └── SConscript │ │ ├── common │ │ │ ├── test_helpers.h │ │ │ ├── malloc_wrappers.h │ │ │ ├── malloc_wrappers_syshdr.h │ │ │ ├── person.proto │ │ │ └── unittests.h │ │ ├── intsizes │ │ │ └── SConscript │ │ ├── namingstyle │ │ │ ├── SConscript │ │ │ └── naming_style.options │ │ ├── alltypes_callback │ │ │ └── alltypes.options │ │ ├── raw_decode │ │ │ └── SConscript │ │ ├── enum_sizes │ │ │ └── SConscript │ │ ├── alltypes_pointer │ │ │ └── alltypes.options │ │ ├── cxx_callback_datatype │ │ │ └── message.proto │ │ ├── mem_release │ │ │ └── SConscript │ │ ├── msgid │ │ │ ├── msgid_example.proto │ │ │ └── SConscript │ │ ├── splint │ │ │ ├── SConscript │ │ │ └── splint.rc │ │ ├── fixed_count │ │ │ ├── SConscript │ │ │ └── fixed_count.proto │ │ ├── callbacks │ │ │ ├── callbacks.proto │ │ │ └── SConscript │ │ ├── Makefile │ │ ├── anonymous_oneof │ │ │ ├── oneof.proto │ │ │ └── SConscript │ │ ├── basic_buffer │ │ │ └── SConscript │ │ ├── basic_stream │ │ │ └── SConscript │ │ ├── oneof │ │ │ ├── oneof.proto │ │ │ └── SConscript │ │ └── oneof_callback │ │ │ ├── SConscript │ │ │ └── oneof.proto │ ├── examples │ │ ├── conan_dependency │ │ │ ├── .gitignore │ │ │ ├── protos │ │ │ │ └── simple.proto │ │ │ ├── CMakeLists.txt │ │ │ └── README.md │ │ ├── platformio │ │ │ ├── proto │ │ │ │ ├── pio_with_options.options │ │ │ │ ├── pio_with_options.proto │ │ │ │ └── pio_without_options.proto │ │ │ ├── src │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── test.h │ │ │ │ ├── pio_esp32_idf.c │ │ │ │ └── pio_with_options.c │ │ │ └── .gitignore │ │ ├── cmake_relpath │ │ │ ├── proto │ │ │ │ ├── sub │ │ │ │ │ └── unlucky.proto │ │ │ │ └── simple.proto │ │ │ ├── CMakeLists.txt │ │ │ └── README.txt │ │ ├── simple │ │ │ ├── simple.proto │ │ │ └── Makefile │ │ ├── cmake_simple │ │ │ ├── simple.proto │ │ │ ├── CMakeLists.txt │ │ │ └── README.txt │ │ ├── network_server │ │ │ ├── common.h │ │ │ ├── Makefile │ │ │ ├── fileproto.proto │ │ │ └── fileproto.options │ │ └── using_union_messages │ │ │ ├── Makefile │ │ │ └── unionproto.proto │ ├── spm-test │ │ ├── objc │ │ │ ├── objc-module.m │ │ │ ├── c-header.c │ │ │ ├── objc-header.m │ │ │ └── objc-qualified.m │ │ └── swift │ │ │ └── main.swift │ ├── docs │ │ ├── logo │ │ │ ├── logo.png │ │ │ ├── logo16px.png │ │ │ └── logo48px.png │ │ └── Makefile │ ├── generator │ │ ├── proto │ │ │ └── Makefile │ │ ├── protoc.bat │ │ ├── protoc-gen-nanopb │ │ ├── protoc-gen-nanopb.bat │ │ ├── nanopb_generator.py2 │ │ └── protoc-gen-nanopb-py2 │ ├── tools │ │ ├── list_authors.sh │ │ └── set_version.sh │ ├── conan-wrapper │ │ └── CMakeLists.txt │ ├── build.py │ ├── .github │ │ └── workflows │ │ │ ├── ios_swift_tests.yml │ │ │ ├── bazel.yml │ │ │ └── cifuzz.yml │ ├── WORKSPACE │ ├── .gitignore │ └── LICENSE.txt ├── .vscode │ ├── .cortex-debug.registers.state.json │ ├── .cortex-debug.peripherals.state.json │ ├── tasks.json │ ├── launch.json │ └── settings.json ├── m6x11.ttf ├── fontconvert.exe ├── libfreetype-6.dll ├── multicore_support.c ├── AudioSampleSecondbloop.h ├── GlobalData.proto ├── m6x118pt7b.h ├── fibonacci.py ├── SongDataInternal.pb.c ├── GlobalDefines.h ├── diagnostics.h ├── tlv320driver.h ├── ParamLockPoolInternal.proto ├── mclk_output.pio ├── SampleFile.h ├── multicore_support.h ├── MidiParamMapper.h ├── VoiceDataInternal.pb.c ├── Serializer.h ├── USBSerialDevice.h └── MidiParamMapper.cc ├── Guide ├── layout.png ├── layout.afdesign ├── InstructionsSmall.pdf └── instructionssmall_typeset.pdf ├── Hardware ├── Schematic.pdf └── audcalc │ └── step │ └── RK10J1_E.STEP ├── Images └── twrtdm_card.jpg ├── Enclosure ├── elements.afdesign ├── frontplate.afdesign ├── guide_images │ ├── play.png │ ├── param.png │ ├── pattern.png │ ├── power.png │ └── write.png ├── printedParts │ ├── Buttons.3mf │ ├── Buttons.stl │ ├── baffles.FCStd │ ├── BackEnclosure.3mf │ ├── BackEnclosure.stl │ ├── FrontEnclosure.3mf │ ├── FrontEnclosure.stl │ ├── printedParts.FCStd │ ├── BackEnclosure.FCStd │ ├── printedParts.FCStd1 │ ├── lightsurroundtest.FCStd │ └── lightsurroundtest.FCStd1 ├── frontplate │ ├── audcom.afdesign │ ├── frontplate_mask.png │ ├── frontplate_silk.png │ ├── fp-lib-table │ ├── generation_notes.txt │ └── frontplate.pro ├── frontplate_guide.afdesign └── frontplate_inverted.afdesign ├── CircuitPython └── lib │ ├── adafruit_ssd1306.mpy │ ├── adafruit_display_text │ ├── label.mpy │ ├── __init__.mpy │ ├── bitmap_label.mpy │ └── scrolling_label.mpy │ └── adafruit_displayio_ssd1306.mpy ├── WebEditor └── index.html └── .gitignore /Firmware/audio/resources/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Firmware/nanopb/extra/bazel/BUILD.bazel: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Firmware/.vscode/.cortex-debug.registers.state.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /Firmware/nanopb/spm_headers/nanopb/pb.h: -------------------------------------------------------------------------------- 1 | ../../pb.h -------------------------------------------------------------------------------- /Firmware/nanopb/tests/site_scons/platforms/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/site_scons/platforms/avr/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Firmware/nanopb/examples/conan_dependency/.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | -------------------------------------------------------------------------------- /Firmware/nanopb/extra/requirements.txt: -------------------------------------------------------------------------------- 1 | grpcio-tools==1.51.3 2 | -------------------------------------------------------------------------------- /Firmware/nanopb/spm-test/objc/objc-module.m: -------------------------------------------------------------------------------- 1 | @import nanopb; 2 | -------------------------------------------------------------------------------- /Firmware/nanopb/spm-test/swift/main.swift: -------------------------------------------------------------------------------- 1 | import nanopb 2 | -------------------------------------------------------------------------------- /Firmware/nanopb/spm_headers/nanopb/pb_common.h: -------------------------------------------------------------------------------- 1 | ../../pb_common.h -------------------------------------------------------------------------------- /Firmware/nanopb/spm_headers/nanopb/pb_decode.h: -------------------------------------------------------------------------------- 1 | ../../pb_decode.h -------------------------------------------------------------------------------- /Firmware/nanopb/spm_headers/nanopb/pb_encode.h: -------------------------------------------------------------------------------- 1 | ../../pb_encode.h -------------------------------------------------------------------------------- /Firmware/nanopb/spm_headers/pb.h: -------------------------------------------------------------------------------- 1 | #include "nanopb/pb.h" 2 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/site_scons/platforms/mips/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/site_scons/platforms/mipsel/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/site_scons/platforms/riscv64/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/site_scons/platforms/stm32/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/generator_relative_paths/any.expected: -------------------------------------------------------------------------------- 1 | Any 2 | -------------------------------------------------------------------------------- /Firmware/nanopb/spm_headers/pb_common.h: -------------------------------------------------------------------------------- 1 | #include "nanopb/pb_common.h" 2 | -------------------------------------------------------------------------------- /Firmware/nanopb/spm_headers/pb_decode.h: -------------------------------------------------------------------------------- 1 | #include "nanopb/pb_decode.h" 2 | -------------------------------------------------------------------------------- /Firmware/nanopb/spm_headers/pb_encode.h: -------------------------------------------------------------------------------- 1 | #include "nanopb/pb_encode.h" 2 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/extensions/extensions.options: -------------------------------------------------------------------------------- 1 | * max_size:16 2 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/generator_relative_paths/test.expected: -------------------------------------------------------------------------------- 1 | TestMessage 2 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/generator_relative_paths/simple.expected: -------------------------------------------------------------------------------- 1 | SimpleMessage 2 | -------------------------------------------------------------------------------- /Guide/layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Guide/layout.png -------------------------------------------------------------------------------- /Firmware/m6x11.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Firmware/m6x11.ttf -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_610/first.expected: -------------------------------------------------------------------------------- 1 | define First_size\s*4 2 | 3 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_195/test.expected: -------------------------------------------------------------------------------- 1 | /\* TestMessage_size depends 2 | -------------------------------------------------------------------------------- /Guide/layout.afdesign: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Guide/layout.afdesign -------------------------------------------------------------------------------- /Firmware/fontconvert.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Firmware/fontconvert.exe -------------------------------------------------------------------------------- /Firmware/nanopb/tests/multiple_files/multifile1.options: -------------------------------------------------------------------------------- 1 | StaticMessage.repint32 max_count:5 2 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_380/manglenames.options: -------------------------------------------------------------------------------- 1 | * mangle_names:M_STRIP_PACKAGE 2 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_524/oneof.expected: -------------------------------------------------------------------------------- 1 | mymessage_MyMessage_size.*[0-9]*$ 2 | -------------------------------------------------------------------------------- /Hardware/Schematic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Hardware/Schematic.pdf -------------------------------------------------------------------------------- /Images/twrtdm_card.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Images/twrtdm_card.jpg -------------------------------------------------------------------------------- /Firmware/libfreetype-6.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Firmware/libfreetype-6.dll -------------------------------------------------------------------------------- /Firmware/nanopb/extra/nanopb-config.cmake: -------------------------------------------------------------------------------- 1 | include(${CMAKE_CURRENT_LIST_DIR}/nanopb-targets.cmake) 2 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/fallback_type/fallback_type.options: -------------------------------------------------------------------------------- 1 | Message1.member2 fallback_type:FT_POINTER 2 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_783/folder_A/file_A.options: -------------------------------------------------------------------------------- 1 | * mangle_names:M_STRIP_PACKAGE 2 | -------------------------------------------------------------------------------- /Enclosure/elements.afdesign: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/elements.afdesign -------------------------------------------------------------------------------- /Enclosure/frontplate.afdesign: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/frontplate.afdesign -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_145/comments.expected: -------------------------------------------------------------------------------- 1 | char foo\[5\]; 2 | char bar\[16\]; 3 | 4 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_172/submessage/submessage.options: -------------------------------------------------------------------------------- 1 | submessage.data max_size: 16 2 | -------------------------------------------------------------------------------- /Guide/InstructionsSmall.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Guide/InstructionsSmall.pdf -------------------------------------------------------------------------------- /Enclosure/guide_images/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/guide_images/play.png -------------------------------------------------------------------------------- /Firmware/.vscode/.cortex-debug.peripherals.state.json: -------------------------------------------------------------------------------- 1 | [{"node":"DMA","expanded":true,"format":0,"pinned":false}] -------------------------------------------------------------------------------- /Firmware/nanopb/examples/platformio/proto/pio_with_options.options: -------------------------------------------------------------------------------- 1 | TestMessageWithOptions.str max_size:16 2 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/backwards_compatibility/alltypes_legacy.options: -------------------------------------------------------------------------------- 1 | * max_size:16 2 | * max_count:5 3 | 4 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_485/uint8.expected: -------------------------------------------------------------------------------- 1 | ! ^\s*[^/* ].*uint8_t 2 | ! ^\s*[^/* ].*int8_t 3 | 4 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/sort_by_tag/sort_by_tag.options: -------------------------------------------------------------------------------- 1 | Unsorted sort_by_tag:false 2 | Sorted sort_by_tag:true 3 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/special_characters/specchars.expected: -------------------------------------------------------------------------------- 1 | int32_t x\[10\]; 2 | Unicode comment эмйÅÄÖ 3 | 4 | -------------------------------------------------------------------------------- /Enclosure/guide_images/param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/guide_images/param.png -------------------------------------------------------------------------------- /Enclosure/guide_images/pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/guide_images/pattern.png -------------------------------------------------------------------------------- /Enclosure/guide_images/power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/guide_images/power.png -------------------------------------------------------------------------------- /Enclosure/guide_images/write.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/guide_images/write.png -------------------------------------------------------------------------------- /Enclosure/printedParts/Buttons.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/printedParts/Buttons.3mf -------------------------------------------------------------------------------- /Enclosure/printedParts/Buttons.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/printedParts/Buttons.stl -------------------------------------------------------------------------------- /Firmware/nanopb/docs/logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Firmware/nanopb/docs/logo/logo.png -------------------------------------------------------------------------------- /Firmware/nanopb/spm-test/objc/c-header.c: -------------------------------------------------------------------------------- 1 | #include "pb.h" 2 | #include "pb_common.h" 3 | #include "pb_decode.h" 4 | -------------------------------------------------------------------------------- /Firmware/nanopb/spm-test/objc/objc-header.m: -------------------------------------------------------------------------------- 1 | #import "pb.h" 2 | #import 3 | #include "pb_decode.h" 4 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/inline/inline.expected: -------------------------------------------------------------------------------- 1 | pb_byte_t data\[32\]; 2 | bool has_data; 3 | pb_byte_t data\[64\]; 4 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_306/large_extension.expected: -------------------------------------------------------------------------------- 1 | PB_BIND\(foo_ext_extmsg, foo_ext_extmsg, 4\) 2 | -------------------------------------------------------------------------------- /Enclosure/frontplate/audcom.afdesign: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/frontplate/audcom.afdesign -------------------------------------------------------------------------------- /Enclosure/frontplate_guide.afdesign: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/frontplate_guide.afdesign -------------------------------------------------------------------------------- /Enclosure/printedParts/baffles.FCStd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/printedParts/baffles.FCStd -------------------------------------------------------------------------------- /Firmware/nanopb/tests/map/map.options: -------------------------------------------------------------------------------- 1 | MyMessage.numbers max_count:10 2 | MyMessage.NumbersEntry.key max_size:16 3 | -------------------------------------------------------------------------------- /Guide/instructionssmall_typeset.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Guide/instructionssmall_typeset.pdf -------------------------------------------------------------------------------- /Hardware/audcalc/step/RK10J1_E.STEP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Hardware/audcalc/step/RK10J1_E.STEP -------------------------------------------------------------------------------- /CircuitPython/lib/adafruit_ssd1306.mpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/CircuitPython/lib/adafruit_ssd1306.mpy -------------------------------------------------------------------------------- /Enclosure/frontplate_inverted.afdesign: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/frontplate_inverted.afdesign -------------------------------------------------------------------------------- /Firmware/audio/resources/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Firmware/audio/resources/__init__.pyc -------------------------------------------------------------------------------- /Firmware/audio/resources/characters.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Firmware/audio/resources/characters.pyc -------------------------------------------------------------------------------- /Firmware/audio/resources/data/map.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Firmware/audio/resources/data/map.bin -------------------------------------------------------------------------------- /Firmware/audio/resources/data/waves.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Firmware/audio/resources/data/waves.bin -------------------------------------------------------------------------------- /Firmware/audio/resources/resources.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Firmware/audio/resources/resources.pyc -------------------------------------------------------------------------------- /Firmware/audio/resources/waveforms.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Firmware/audio/resources/waveforms.pyc -------------------------------------------------------------------------------- /Firmware/nanopb/docs/logo/logo16px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Firmware/nanopb/docs/logo/logo16px.png -------------------------------------------------------------------------------- /Firmware/nanopb/docs/logo/logo48px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Firmware/nanopb/docs/logo/logo48px.png -------------------------------------------------------------------------------- /Firmware/nanopb/examples/platformio/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register( 2 | SRCS 3 | pio_esp32_idf.c) 4 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/fallback_type/fallback_type.expected: -------------------------------------------------------------------------------- 1 | int32_t member1; 2 | char \*member2 3 | pb_callback_t member3 4 | -------------------------------------------------------------------------------- /Enclosure/frontplate/frontplate_mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/frontplate/frontplate_mask.png -------------------------------------------------------------------------------- /Enclosure/frontplate/frontplate_silk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/frontplate/frontplate_silk.png -------------------------------------------------------------------------------- /Enclosure/printedParts/BackEnclosure.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/printedParts/BackEnclosure.3mf -------------------------------------------------------------------------------- /Enclosure/printedParts/BackEnclosure.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/printedParts/BackEnclosure.stl -------------------------------------------------------------------------------- /Enclosure/printedParts/FrontEnclosure.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/printedParts/FrontEnclosure.3mf -------------------------------------------------------------------------------- /Enclosure/printedParts/FrontEnclosure.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/printedParts/FrontEnclosure.stl -------------------------------------------------------------------------------- /Enclosure/printedParts/printedParts.FCStd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/printedParts/printedParts.FCStd -------------------------------------------------------------------------------- /Firmware/audio/resources/waveshapers.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Firmware/audio/resources/waveshapers.pyc -------------------------------------------------------------------------------- /Firmware/nanopb/examples/platformio/.gitignore: -------------------------------------------------------------------------------- 1 | .pio/ 2 | .idea/ 3 | cmake-build-*/ 4 | /CMakeLists.txt 5 | CMakeListsPrivate.txt 6 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/fuzztest/corpus.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Firmware/nanopb/tests/fuzztest/corpus.zip -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_125/extensionbug.expected: -------------------------------------------------------------------------------- 1 | pb_extension_type_t Message2_extras 2 | uint32_t field2 3 | 4 | -------------------------------------------------------------------------------- /Enclosure/printedParts/BackEnclosure.FCStd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/printedParts/BackEnclosure.FCStd -------------------------------------------------------------------------------- /Enclosure/printedParts/printedParts.FCStd1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/printedParts/printedParts.FCStd1 -------------------------------------------------------------------------------- /Firmware/audio/resources/lookup_tables.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Firmware/audio/resources/lookup_tables.pyc -------------------------------------------------------------------------------- /Firmware/nanopb/tests/map/map.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | message MyMessage { 4 | map numbers = 1; 5 | } 6 | 7 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_617/oneof.options: -------------------------------------------------------------------------------- 1 | * long_names : false 2 | 3 | NoDecode.name max_length : 32 4 | 5 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/special_characters/funny-proto+name has.characters.options: -------------------------------------------------------------------------------- 1 | // Unicode comment эмйÅÄÖ 2 | * max_count:10 3 | 4 | -------------------------------------------------------------------------------- /Enclosure/printedParts/lightsurroundtest.FCStd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/printedParts/lightsurroundtest.FCStd -------------------------------------------------------------------------------- /Firmware/nanopb/spm-test/objc/objc-qualified.m: -------------------------------------------------------------------------------- 1 | #import "nanopb/pb.h" 2 | #import 3 | #include "nanopb/pb_decode.h" 4 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/fuzztest/regressions.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Firmware/nanopb/tests/fuzztest/regressions.zip -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_610/LogMessage.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | message LogMessage { 4 | string msg = 1; 5 | } 6 | -------------------------------------------------------------------------------- /CircuitPython/lib/adafruit_display_text/label.mpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/CircuitPython/lib/adafruit_display_text/label.mpy -------------------------------------------------------------------------------- /CircuitPython/lib/adafruit_displayio_ssd1306.mpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/CircuitPython/lib/adafruit_displayio_ssd1306.mpy -------------------------------------------------------------------------------- /Enclosure/printedParts/lightsurroundtest.FCStd1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Enclosure/printedParts/lightsurroundtest.FCStd1 -------------------------------------------------------------------------------- /Firmware/nanopb/tests/any_type/google/protobuf/any.options: -------------------------------------------------------------------------------- 1 | google.protobuf.Any.type_url max_size:64 2 | google.protobuf.Any.value max_size:64 3 | -------------------------------------------------------------------------------- /Firmware/multicore_support.c: -------------------------------------------------------------------------------- 1 | #include "multicore_support.h" 2 | 3 | queue_t signal_queue; 4 | queue_t complete_queue; 5 | queue_t renderCompleteQueue; -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_610/nanopb_generator_bug/first/a/aa.proto: -------------------------------------------------------------------------------- 1 | syntax="proto3"; 2 | 3 | package first.a; 4 | 5 | message A {} 6 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_610/nanopb_generator_bug/first/a/ab.proto: -------------------------------------------------------------------------------- 1 | syntax="proto3"; 2 | 3 | package first.a; 4 | 5 | message B {} 6 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_610/nanopb_generator_bug/first/b/ba.proto: -------------------------------------------------------------------------------- 1 | syntax="proto3"; 2 | 3 | package first.b; 4 | 5 | message A {} 6 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_637/other.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | message SecondOneof { 4 | repeated int32 foo = 1; 5 | } 6 | 7 | -------------------------------------------------------------------------------- /CircuitPython/lib/adafruit_display_text/__init__.mpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/CircuitPython/lib/adafruit_display_text/__init__.mpy -------------------------------------------------------------------------------- /Firmware/AudioSampleSecondbloop.h: -------------------------------------------------------------------------------- 1 | // Audio data converted from WAV file by wav2sketch 2 | 3 | extern const unsigned int AudioSampleSecondbloop[16065]; 4 | -------------------------------------------------------------------------------- /Firmware/nanopb/examples/cmake_relpath/proto/sub/unlucky.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message UnluckyNumber { 4 | required uint32 number = 1; 5 | } 6 | -------------------------------------------------------------------------------- /Firmware/nanopb/examples/platformio/proto/pio_with_options.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | message TestMessageWithOptions { 4 | string str = 1; 5 | } 6 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/enum_mapping/enum_mapping.expected: -------------------------------------------------------------------------------- 1 | define TestMsg_test1_ENUMTYPE TestEnum1 2 | define TestMsg_oneof1_test2_ENUMTYPE TestEnum2 3 | 4 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/float_double_conversion/doublemsg.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message DoubleMsg { 4 | required double value = 1; 5 | } 6 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_172/submessage/submessage.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | message submessage { 3 | required bytes data = 1; 4 | } 5 | -------------------------------------------------------------------------------- /CircuitPython/lib/adafruit_display_text/bitmap_label.mpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/CircuitPython/lib/adafruit_display_text/bitmap_label.mpy -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_125/extensionbug.options: -------------------------------------------------------------------------------- 1 | * type:FT_IGNORE 2 | 3 | Message2.extras type:FT_STATIC 4 | Message2.field2 type:FT_STATIC 5 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_376/fixed_array.options: -------------------------------------------------------------------------------- 1 | SubMessage.data fixed_count:true,max_count:8 2 | MainMessage.submsg proto3_singular_msgs:true 3 | -------------------------------------------------------------------------------- /CircuitPython/lib/adafruit_display_text/scrolling_label.mpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/CircuitPython/lib/adafruit_display_text/scrolling_label.mpy -------------------------------------------------------------------------------- /Firmware/nanopb/examples/platformio/proto/pio_without_options.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | message TestMessageWithoutOptions { 4 | int32 number = 1; 5 | } 6 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/decode_unittests/SConscript: -------------------------------------------------------------------------------- 1 | Import('env') 2 | p = env.Program(["decode_unittests.c", "$COMMON/unittestproto.pb.c"]) 3 | env.RunTest(p) 4 | 5 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_188/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for issue with Enums inside OneOf. 2 | 3 | Import('env') 4 | 5 | env.NanopbProto('oneof') 6 | 7 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_395/test.options: -------------------------------------------------------------------------------- 1 | * proto3_singular_msgs:true 2 | SubSubAMessage.somestring max_size:64 3 | SubSubBMessage.somestring max_size:64 4 | -------------------------------------------------------------------------------- /Firmware/audio/resources/__pycache__/characters.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Firmware/audio/resources/__pycache__/characters.cpython-38.pyc -------------------------------------------------------------------------------- /Firmware/audio/resources/__pycache__/characters.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Firmware/audio/resources/__pycache__/characters.cpython-39.pyc -------------------------------------------------------------------------------- /Firmware/nanopb/tests/options/options_c.expected: -------------------------------------------------------------------------------- 1 | PB_BIND\(Message1, Message1, AUTO\) 2 | PB_BIND\(WideMessage, WideMessage, 4\) 3 | PB_BIND\(WideMessage2, WideMessage2, 8\) 4 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_172/test.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | import "submessage.proto"; 3 | 4 | message testmessage { 5 | optional submessage sub = 1; 6 | } 7 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_453/test.proto: -------------------------------------------------------------------------------- 1 | syntax = 'proto2'; 2 | 3 | message MyMessage 4 | { 5 | optional float myfield = 1 [default = 1.234]; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_611/uenum.expected: -------------------------------------------------------------------------------- 1 | STATIC.* ONEOF.* ENUM.*MyEnum 2 | STATIC.* ONEOF.* UENUM.*MyUEnum 3 | ! [^U]ENUM.*MyUEnum 4 | ! UENUM.*MyEnum 5 | 6 | -------------------------------------------------------------------------------- /Firmware/audio/resources/__pycache__/lookup_tables.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonbro/Audcalc/HEAD/Firmware/audio/resources/__pycache__/lookup_tables.cpython-38.pyc -------------------------------------------------------------------------------- /Firmware/nanopb/tests/alltypes_proto3/alltypes.options: -------------------------------------------------------------------------------- 1 | * max_size:16 2 | * max_count:5 3 | *.*fbytes fixed_length:true max_size:4 4 | *.req_limits proto3_singular_msgs:true 5 | 6 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/fuzztest/alltypes_proto3_static.options: -------------------------------------------------------------------------------- 1 | * max_size:32 2 | * max_count:8 3 | *.*fbytes fixed_length:true max_size:4 4 | *.req_limits proto3_singular_msgs:true 5 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_338/SConscript: -------------------------------------------------------------------------------- 1 | # Check that generator doesn't exceed memory limits 2 | 3 | Import('env') 4 | 5 | env.NanopbProto('bigvalue') 6 | 7 | 8 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/options/proto3_options.expected: -------------------------------------------------------------------------------- 1 | ! bool has_proto3_default 2 | bool has_proto3_off 3 | ! bool has_proto3_on 4 | bool has_normal_submsg 5 | ! bool has_sng_submsg 6 | -------------------------------------------------------------------------------- /Enclosure/frontplate/fp-lib-table: -------------------------------------------------------------------------------- 1 | (fp_lib_table 2 | (lib (name project)(type KiCad)(uri C:/Users/jonbro/Documents/Projects/TDM/Enclosure/graphic_footprints)(options "")(descr "")) 3 | ) 4 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_145/comments.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message DummyMessage { 4 | required string foo = 1; 5 | required string bar = 2; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/generator_relative_paths/test.proto: -------------------------------------------------------------------------------- 1 | syntax="proto3"; 2 | 3 | import "nanopb.proto"; 4 | 5 | message TestMessage { 6 | string foo = 1 [(nanopb).max_size = 16]; 7 | } 8 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_783/folder_A/file_A.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | package folder_A; 3 | enum my_enum { 4 | ENUM_0 = 0; 5 | ENUM_1 = 1; 6 | ENUM_2 = 2; 7 | } 8 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_795/test2.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | enum TestEnum { 4 | TEST_0 = 0; 5 | } 6 | 7 | message TestMsg { 8 | TestEnum a = 1; 9 | } 10 | -------------------------------------------------------------------------------- /Firmware/GlobalData.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import 'nanopb.proto'; 3 | 4 | message GlobalData 5 | { 6 | uint32 version = 1; 7 | uint32 songId = 2; 8 | } -------------------------------------------------------------------------------- /Firmware/nanopb/tests/fuzztest/alltypes_callback.options: -------------------------------------------------------------------------------- 1 | *.rep_* type:FT_CALLBACK 2 | *.oneof_* submsg_callback:true 3 | *.Limits.int64_min type:FT_CALLBACK 4 | *.DescriptorSize8 descriptorsize:DS_8 5 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/fuzztest/alltypes_proto3_pointer.options: -------------------------------------------------------------------------------- 1 | * type:FT_POINTER 2 | *.static_msg type:FT_STATIC 3 | *.*fbytes fixed_length:true max_size:4 4 | *.req_limits proto3_singular_msgs:true 5 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/no_messages/no_messages.proto: -------------------------------------------------------------------------------- 1 | /* Test that a file without any messages works. */ 2 | 3 | syntax = "proto2"; 4 | 5 | enum Test { 6 | First = 1; 7 | } 8 | 9 | 10 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_118/enumuse.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import 'enumdef.proto'; 4 | 5 | message MyMessage { 6 | required MyEnum myenum = 1 [default = FOOBAR]; 7 | } 8 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/stackusage/stackusage.options: -------------------------------------------------------------------------------- 1 | * long_names : false 2 | SettingsGroup.Settings.name max_length : 32 3 | SettingsGroup.Settings.Command.properties max_count : 6 4 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/common_unittests/SConscript: -------------------------------------------------------------------------------- 1 | # Test functions in pb_common.c 2 | 3 | Import('env') 4 | p = env.Program(["common_unittests.c", "$BUILD/alltypes/alltypes.pb.c"]) 5 | env.RunTest(p) 6 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/generator_relative_paths/proto/simple.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "protobuf/any.proto"; 4 | 5 | message SimpleMessage { 6 | google.protobuf.Any any = 1; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_118/enumdef.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import 'nanopb.proto'; 4 | 5 | enum MyEnum { 6 | option (nanopb_enumopt).long_names = false; 7 | FOOBAR = 1; 8 | } 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_547/test.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "nanopb.proto"; 4 | 5 | message MyMessage { 6 | required bytes mybytes = 1 [(nanopb).max_size = 512]; 7 | } 8 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/no_messages/SConscript: -------------------------------------------------------------------------------- 1 | # Test that a .proto file without any messages compiles fine. 2 | 3 | Import("env") 4 | 5 | env.NanopbProto("no_messages") 6 | env.Object('no_messages.pb.c') 7 | 8 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_692/other.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | message SecondOneof { 4 | repeated int32 foo = 1; 5 | } 6 | 7 | message AnotherList { 8 | repeated int32 bar = 1; 9 | } -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_795/test3.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "test2.proto"; 4 | 5 | package test3.package; 6 | 7 | message TestMessage { 8 | TestEnum a = 1; 9 | } 10 | -------------------------------------------------------------------------------- /Firmware/nanopb/generator/proto/Makefile: -------------------------------------------------------------------------------- 1 | PROTOC?=../protoc 2 | 3 | all: nanopb_pb2.py 4 | 5 | %_pb2.py: %.proto 6 | $(PROTOC) --python_out=. $< 7 | 8 | .PHONY: clean 9 | clean: 10 | rm nanopb_pb2.py 11 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/message_sizes/dummy.c: -------------------------------------------------------------------------------- 1 | /* Just test that the file can be compiled successfully. */ 2 | 3 | #include "messages2.pb.h" 4 | 5 | int main() 6 | { 7 | return xmit_size; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/GHSA-gcx3-7m76-287p/test.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | import "nanopb.proto"; 3 | 4 | message MyMessage { 5 | repeated string values = 1 [(nanopb).type = FT_POINTER]; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_253/short_array.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | import "nanopb.proto"; 3 | 4 | message TestMessage { 5 | repeated uint32 rep_uint32 = 1 [(nanopb).max_count = 1]; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_487/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #487: 2 | # Problem in default_value() with nested messages 3 | 4 | Import("env") 5 | env.NanopbProto("test") 6 | env.Object("test.pb.c") 7 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_535/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #535: 2 | # Generator crash on enums with aliases 3 | 4 | Import("env") 5 | env.NanopbProto("issue_535") 6 | env.Object("issue_535.pb.c") 7 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/without_64bit/alltypes.options: -------------------------------------------------------------------------------- 1 | * max_size:16 2 | * max_count:5 3 | *.*fbytes fixed_length:true max_size:4 4 | *.*farray fixed_count:true max_count:5 5 | DescriptorSize8 descriptorsize:DS_8 6 | -------------------------------------------------------------------------------- /Firmware/nanopb/tools/list_authors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sed -ir '/^\s*$/d' AUTHORS.txt # Remove empty lines 4 | 5 | echo "New authors:" 6 | git log --format='%aN <%aE>' | grep -vFf AUTHORS.txt | sort -u 7 | 8 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/enum_to_string/SConscript: -------------------------------------------------------------------------------- 1 | # Test enum to string functionality 2 | 3 | Import('env') 4 | env.NanopbProto("enum.proto") 5 | p = env.Program(["enum_to_string.c", "enum.pb.c"]) 6 | env.RunTest(p) 7 | 8 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/field_size_16_proto3/alltypes.options: -------------------------------------------------------------------------------- 1 | * max_size:16 2 | * max_count:5 3 | *.*fbytes fixed_length:true max_size:4 4 | SubMessage.substuff1 max_size:256 5 | *.req_limits proto3_singular_msgs:true 6 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_172/msg_size.c: -------------------------------------------------------------------------------- 1 | #include "test.pb.h" 2 | 3 | PB_STATIC_ASSERT(testmessage_size >= 1+1+1+1+16, TESTMESSAGE_SIZE_IS_WRONG) 4 | 5 | int main() 6 | { 7 | return 0; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_203/file1.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message SubMessage1 { 4 | required int32 foo = 1; 5 | } 6 | 7 | message Message1 { 8 | required SubMessage1 bar = 1; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_203/file2.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message SubMessage2 { 4 | required int32 foo = 1; 5 | } 6 | 7 | message Message2 { 8 | required SubMessage2 bar = 1; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_306/large_extension.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message Foo { 4 | extensions 1 to max; 5 | } 6 | 7 | extend Foo { 8 | optional int32 foo_ext = 99999; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_145/comments.options: -------------------------------------------------------------------------------- 1 | /* Block comment */ 2 | # Line comment 3 | // Line comment 4 | DummyMessage.foo /* Block comment */ max_size:5 5 | DummyMessage.bar max_size:16 # Line comment ### 6 | 7 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_472/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for issue #472: submsg_callback fails to compile in Atmel Studio 2 | 3 | Import("env") 4 | 5 | env.NanopbProto("test") 6 | env.Object("test.pb.c") 7 | 8 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/comments/SConscript: -------------------------------------------------------------------------------- 1 | # Test comment inclusion from .proto to .pb.h 2 | 3 | Import("env") 4 | 5 | env.NanopbProto("comments") 6 | env.Object("comments.pb.c") 7 | env.Match(['comments.pb.h', 'comments.expected']) 8 | 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/encode_unittests/SConscript: -------------------------------------------------------------------------------- 1 | # Build and run the stand-alone unit tests for the nanopb encoder part. 2 | 3 | Import('env') 4 | p = env.Program(["encode_unittests.c", "$COMMON/unittestproto.pb.c"]) 5 | env.RunTest(p) 6 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_376/fixed_array.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | message MainMessage { 4 | SubMessage submsg = 1; 5 | } 6 | 7 | message SubMessage { 8 | repeated int32 data = 1; 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_610/DataPacket.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "LogMessage.proto"; 4 | 5 | message DataPacket { 6 | oneof packet { 7 | LogMessage log_message = 1; 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_746/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #746: 2 | # Name conflict when generating default values for message 3 | 4 | Import("env") 5 | 6 | env.NanopbProto("test.proto") 7 | env.Object("test.pb.c") 8 | 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/conan-wrapper/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.12) 2 | project(cmake_wrapper) 3 | 4 | include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake) 5 | conan_basic_setup() 6 | 7 | add_subdirectory(".." "nanopb") 8 | -------------------------------------------------------------------------------- /Firmware/nanopb/examples/simple/simple.proto: -------------------------------------------------------------------------------- 1 | // A very simple protocol definition, consisting of only 2 | // one message. 3 | 4 | syntax = "proto2"; 5 | 6 | message SimpleMessage { 7 | required int32 lucky_number = 1; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /Firmware/nanopb/build.py: -------------------------------------------------------------------------------- 1 | from conan.packager import ConanMultiPackager 2 | 3 | if __name__ == "__main__": 4 | builder = ConanMultiPackager(build_policy="outdated") 5 | builder.add_common_builds(shared_option_name=None) 6 | builder.run() 7 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/enum_mapping/SConscript: -------------------------------------------------------------------------------- 1 | # Test generated ENUMTYPE defines 2 | 3 | Import('env') 4 | 5 | env.NanopbProto('enum_mapping') 6 | env.Object("enum_mapping.pb.c") 7 | env.Match(["enum_mapping.pb.h", "enum_mapping.expected"]) 8 | 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_227/unaligned_uint64.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import 'nanopb.proto'; 3 | 4 | message MainMessage { 5 | string foo = 1 [(nanopb).max_size = 3]; 6 | string bar = 2 [(nanopb).max_size = 8]; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/typename_mangling/with_package.options: -------------------------------------------------------------------------------- 1 | * long_names:true 2 | 3 | com.example.nanopb.TopLevelMessage.ShortIfNone long_names:false 4 | TopLevelMessage.ShortIfStripPackage long_names:false 5 | ShortIfFlatten long_names: false 6 | -------------------------------------------------------------------------------- /Firmware/nanopb/examples/cmake_simple/simple.proto: -------------------------------------------------------------------------------- 1 | // A very simple protocol definition, consisting of only 2 | // one message. 3 | 4 | syntax = "proto2"; 5 | 6 | message SimpleMessage { 7 | required int32 lucky_number = 1; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /Firmware/nanopb/examples/network_server/common.h: -------------------------------------------------------------------------------- 1 | #ifndef _PB_EXAMPLE_COMMON_H_ 2 | #define _PB_EXAMPLE_COMMON_H_ 3 | 4 | #include 5 | 6 | pb_ostream_t pb_ostream_from_socket(int fd); 7 | pb_istream_t pb_istream_from_socket(int fd); 8 | 9 | #endif -------------------------------------------------------------------------------- /Firmware/nanopb/tests/field_size_32/alltypes.options: -------------------------------------------------------------------------------- 1 | * max_size:16 2 | * max_count:5 3 | *.*fbytes fixed_length:true max_size:4 4 | *.*farray fixed_count:true max_count:5 5 | *.*farray2 fixed_count:true max_count:3 6 | DescriptorSize8 descriptorsize:DS_8 7 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_342/extensions.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message BaseMessage { 4 | extensions 100 to 200; 5 | } 6 | 7 | extend BaseMessage { 8 | optional string string_extension = 100; 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_644/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #644: 2 | # Generator fails to account for padding when estimating struct size 3 | 4 | Import("env") 5 | 6 | env.NanopbProto("int64.proto") 7 | env.Object("int64.pb.c") 8 | 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/enum_minmax/SConscript: -------------------------------------------------------------------------------- 1 | # Test that different sizes of enum fields are properly encoded and decoded. 2 | 3 | Import('env') 4 | 5 | env.NanopbProto('enumminmax') 6 | 7 | p = env.Program(["enumminmax_unittests.c",]) 8 | env.RunTest(p) 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/field_size_16/alltypes.options: -------------------------------------------------------------------------------- 1 | * max_size:16 2 | * max_count:5 3 | *.*fbytes fixed_length:true max_size:4 4 | *.*farray fixed_count:true max_count:5 5 | *.*farray2 fixed_count:true max_count:3 6 | DescriptorSize8 descriptorsize:DS_8 7 | 8 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/proto3_optional/optional.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | message TestMessage { 4 | optional int32 opt_int = 1; 5 | int32 normal_int = 2; 6 | optional int32 opt_int2 = 3; 7 | int32 normal_int2 = 4; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_545/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #545: 2 | # Field descriptor width automatic sizing is inaccurate with oneofs 3 | 4 | Import("env") 5 | env.NanopbProto("submsg_callback") 6 | env.Object("submsg_callback.pb.c") 7 | 8 | -------------------------------------------------------------------------------- /Firmware/m6x118pt7b.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pico/stdlib.h" 3 | #include "gfxfont.h" 4 | 5 | extern const uint8_t m6x118pt7bBitmaps[]; 6 | extern const GFXglyph m6x118pt7bGlyphs[]; 7 | extern const GFXfont m6x118pt7b; 8 | 9 | // Approx. 1365 bytes 10 | -------------------------------------------------------------------------------- /Firmware/nanopb/examples/conan_dependency/protos/simple.proto: -------------------------------------------------------------------------------- 1 | // A very simple protocol definition, consisting of only 2 | // one message. 3 | 4 | syntax = "proto2"; 5 | 6 | message SimpleMessage { 7 | required int32 lucky_number = 1; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_195/test.proto: -------------------------------------------------------------------------------- 1 | message TestMessage { 2 | required uint32 id = 1; 3 | required bytes payload = 2; 4 | } 5 | message EncapsulatedMessage { 6 | required uint32 id = 1; 7 | required TestMessage test = 2; 8 | } 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_637/test.c: -------------------------------------------------------------------------------- 1 | /* This fakes the situation where other.proto is not found for some reason 2 | * by making its size indefinite, but then defining it here manually. */ 3 | 4 | #define SecondOneof_size 5 5 | #include "oneof.pb.h" 6 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/fallback_type/SConscript: -------------------------------------------------------------------------------- 1 | # Test fallback_type option 2 | 3 | Import("env") 4 | 5 | env.NanopbProto(["fallback_type","fallback_type.options"]) 6 | env.Object("fallback_type.pb.c") 7 | env.Match(['fallback_type.pb.h', 'fallback_type.expected']) 8 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_306/SConscript: -------------------------------------------------------------------------------- 1 | # Check that generator gives a warning about large extension field number. 2 | 3 | Import('env') 4 | 5 | env.NanopbProto('large_extension') 6 | 7 | env.Match(['large_extension.pb.c', 'large_extension.expected']) 8 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_535/issue_535.proto: -------------------------------------------------------------------------------- 1 | /* Test generation of enums with aliases */ 2 | 3 | syntax = "proto3"; 4 | 5 | enum EnumWithAliases { 6 | option allow_alias = true; 7 | First = 0; 8 | Second = 1; 9 | AlsoSecond = 1; 10 | } 11 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_569/a.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package a; 4 | 5 | message AUnknown { 6 | string data = 1; 7 | } 8 | 9 | message A { 10 | oneof data { 11 | AUnknown unknown = 1; 12 | int32 x = 2; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_493/test.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | import "nanopb.proto"; 3 | 4 | message MyMessage { 5 | option (nanopb_msgopt).msgid = 8; 6 | oneof configuration_flash { 7 | MyMessage my_message_v1 = 1; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_647/repro.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "nanopb.proto"; 4 | 5 | message Repro { 6 | oneof value_type { 7 | bool boolean_value = 1; 8 | bytes bytes_value = 5 [(nanopb).type = FT_POINTER]; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_783/folder_C/file_C.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "nanopb.proto"; 4 | 5 | package folder_C; 6 | option (nanopb_fileopt).package = "dir_C"; 7 | 8 | message messageC { 9 | required uint32 a = 1; 10 | } 11 | 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/cxx_descriptor/message.proto: -------------------------------------------------------------------------------- 1 | /* Test CPP descriptor generation */ 2 | 3 | syntax = "proto2"; 4 | 5 | import "nanopb.proto"; 6 | 7 | message MyEmptyMessage { 8 | } 9 | 10 | message MyNonEmptyMessage { 11 | optional uint32 field = 1; 12 | } 13 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/message_sizes/messages2.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import 'nanopb.proto'; 4 | import 'messages1.proto'; 5 | 6 | message xmit { 7 | required MessageHeader header = 1; 8 | required bytes data = 2 [(nanopb).max_size = 128]; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_229/multiple_oneof.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message MainMessage { 4 | oneof oneof1 { 5 | uint32 oneof1_uint32 = 1; 6 | } 7 | oneof oneof2 { 8 | uint32 oneof2_uint32 = 2; 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_610/nanopb_generator_bug/first/b.proto: -------------------------------------------------------------------------------- 1 | syntax="proto3"; 2 | 3 | package first; 4 | 5 | import "nanopb_generator_bug/first/b/ba.proto"; 6 | 7 | message B { 8 | oneof oneof_b { 9 | b.A obj_a = 1; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_558/mixed.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "nanopb.proto"; 4 | 5 | message MixedMessage { 6 | optional int32 proto2_value = 1 [default = 100]; 7 | optional int32 proto3_value = 2 [default = 200, (nanopb).proto3 = true]; 8 | } 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_692/test.c: -------------------------------------------------------------------------------- 1 | /* This fakes the situation where other.proto was not found at generation time, 2 | so size_union declarations are generated. */ 3 | 4 | #define SecondOneof_size 88 5 | #define AnotherList_size 88 6 | 7 | #include "oneof.pb.h" 8 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_141/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for issue 141: wrong encoded size #define for oneof messages 2 | 3 | Import("env") 4 | 5 | env.NanopbProto("testproto") 6 | env.Object('testproto.pb.c') 7 | env.Match(['testproto.pb.h', 'testproto.expected']) 8 | 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_611/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #611: 2 | # Enum messages inside OneOf generated as ENUM instead of UENUM 3 | 4 | Import("env") 5 | 6 | env.NanopbProto("uenum.proto") 7 | env.Match(["uenum.pb.h", "uenum.expected"]) 8 | env.Object("uenum.pb.c") 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_631/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #631: 2 | # Wrong initializer generation 3 | 4 | Import("env") 5 | 6 | env.NanopbProto("submsg_callback.proto") 7 | t = env.Program(["test.c", "submsg_callback.pb.c", "$COMMON/pb_common.o"]) 8 | env.RunTest(t) 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_838/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for issue #838: 2 | # Test enum to string functionality with C++ main program 3 | 4 | Import('env') 5 | env.NanopbProto("enum.proto") 6 | p = env.Program(["enum_to_string.cxx", "enum.pb.c"]) 7 | env.RunTest(p) 8 | 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_249/test.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "nanopb.proto"; 3 | 4 | message SubMessage { 5 | repeated int32 foo = 1; 6 | } 7 | 8 | message MainMessage { 9 | SubMessage submsg = 1 [(nanopb).proto3_singular_msgs = true]; 10 | } 11 | 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/cyclic_messages/cyclic_callback.options: -------------------------------------------------------------------------------- 1 | TreeNode.left type:FT_CALLBACK 2 | TreeNode.right type:FT_CALLBACK 3 | 4 | KeyValuePair.key max_size:8 5 | KeyValuePair.stringValue max_size:8 6 | KeyValuePair.treeValue type:FT_CALLBACK 7 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_141/testproto.expected: -------------------------------------------------------------------------------- 1 | define SubMessage_size \s* 88 2 | define OneOfMessage_size \s* 113 3 | define topMessage_size \s* 70 4 | define MyMessage1_size \s* 46 5 | define MyMessage2_size \s* 8 6 | define MyMessage3_size \s* 5 7 | define MyMessage4_size \s* 18 8 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/stackusage/SConscript: -------------------------------------------------------------------------------- 1 | # Test stack usage 2 | 3 | Import("env") 4 | 5 | env.NanopbProto(["stackusage", "stackusage.options"]) 6 | test = env.Program(["stackusage.c", "stackusage.pb.c", "$COMMON/pb_encode.o", "$COMMON/pb_decode.o", "$COMMON/pb_common.o"]) 7 | env.RunTest(test) 8 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/infinity_nan/SConscript: -------------------------------------------------------------------------------- 1 | # Build and run a basic test for floating point default values. 2 | 3 | Import("env") 4 | 5 | env.NanopbProto("floats") 6 | test = env.Program(["infinity_nan_test.c", "floats.pb.c", "$COMMON/pb_decode.o", "$COMMON/pb_common.o"]) 7 | 8 | env.RunTest(test) 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_494/oneof.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "submessage.proto"; 4 | 5 | message MyMessage 6 | { 7 | oneof foo 8 | { 9 | SubMessage1 msg1 = 1; 10 | SubMessage2 msg2 = 2; 11 | SubMessage3 msg3 = 3; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/fallback_type/fallback_type.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message Message1 4 | { 5 | required int32 member1 = 1; // must remain as int 6 | required string member2 = 2; // must become a pointer 7 | required string member3 = 3; // must become pb_callback_t 8 | } 9 | 10 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/docker_images/build_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # Run all targets 4 | for file in `ls */Dockerfile` 5 | do echo -e "\n\n\n---------------------------------------- Building image for" $file " -------------------------------------------\n\n\n" 6 | docker build $(dirname $file) 7 | done 8 | 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/extra_fields/person_with_extra_field.expected: -------------------------------------------------------------------------------- 1 | name: "Test Person 99" 2 | id: 99 3 | email: "test@person.com" 4 | phone { 5 | number: "555-12345678" 6 | type: MOBILE 7 | } 8 | phone { 9 | number: "99-2342" 10 | } 11 | phone { 12 | number: "1234-5678" 13 | type: WORK 14 | } 15 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_453/test.c: -------------------------------------------------------------------------------- 1 | #include "test.pb.h" 2 | #include "unittests.h" 3 | 4 | int main() 5 | { 6 | int status = 0; 7 | MyMessage msg = MyMessage_init_default; 8 | TEST(msg.myfield >= 1.23399f); 9 | TEST(msg.myfield <= 1.23401f); 10 | return status; 11 | } 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/alltypes/alltypes.options: -------------------------------------------------------------------------------- 1 | * max_size:16 2 | * max_count:5 3 | *.*fbytes fixed_length:true max_size:4 4 | *.*farray fixed_count:true max_count:5 5 | *.*farray2 fixed_count:true max_count:3 6 | IntSizes.*int8 int_size:IS_8 7 | IntSizes.*int16 int_size:IS_16 8 | DescriptorSize8 descriptorsize:DS_8 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/io_errors/alltypes.options: -------------------------------------------------------------------------------- 1 | * max_size:16 2 | * max_count:5 3 | *.*fbytes fixed_length:true max_size:4 4 | *.*farray fixed_count:true max_count:5 5 | *.*farray2 fixed_count:true max_count:3 6 | IntSizes.*int8 int_size:IS_8 7 | IntSizes.*int16 int_size:IS_16 8 | DescriptorSize8 descriptorsize:DS_8 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_247/padding.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "nanopb.proto"; 3 | 4 | message SubMessage { 5 | bool boolfield = 1; 6 | int64 intfield = 2; 7 | } 8 | 9 | message TestMessage { 10 | SubMessage submsg = 1 [(nanopb).proto3_singular_msgs = true]; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_494/submessage.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | message SubMessage1 4 | { 5 | uint32 foo = 1; 6 | } 7 | 8 | message SubMessage2 9 | { 10 | uint32 foo = 1; 11 | } 12 | 13 | message SubMessage3 14 | { 15 | uint32 foo = 1; 16 | uint32 bar = 2; 17 | } 18 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_783/folder_B/file_B.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | package folder_B; 3 | 4 | import "folder_A/file_A.proto"; 5 | import "folder_C/file_C.proto"; 6 | 7 | message dummy { 8 | required folder_A.my_enum value = 1; 9 | required folder_C.messageC msg = 2; 10 | } 11 | -------------------------------------------------------------------------------- /Firmware/fibonacci.py: -------------------------------------------------------------------------------- 1 | last = 0 2 | current = 1 3 | 4 | def next(): 5 | global last 6 | global current 7 | new = last + current 8 | last = current 9 | current = new 10 | 11 | for x in range(10000000): 12 | next() 13 | # print(str(x+1) + ": " + str(current) + "\n") 14 | 15 | print(current) -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_145/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for Issue 145: Allow /* */ and // comments in .options files 2 | 3 | Import("env") 4 | 5 | env.NanopbProto(["comments", "comments.options"]) 6 | env.Object('comments.pb.c') 7 | 8 | env.Match(['comments.pb.h', 'comments.expected']) 9 | 10 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_205/size_corruption.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | import 'nanopb.proto'; 3 | 4 | message SubMessage { 5 | repeated int32 foo = 1 [(nanopb).type = FT_POINTER]; 6 | } 7 | 8 | message MainMessage { 9 | repeated SubMessage bar = 1 [(nanopb).max_count = 5]; 10 | } 11 | 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_637/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #637: 2 | # Generator produces incorrect output when a oneof is used 3 | 4 | Import("env") 5 | 6 | env.NanopbProto("other.proto") 7 | env.NanopbProto(["oneof.proto", "other.proto"]) 8 | env.Object("oneof.pb.c") 9 | env.Object("test.c") 10 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_259/callback_pointer.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | import 'nanopb.proto'; 3 | 4 | message SubMessage { 5 | optional int32 foo = 1 [(nanopb).type = FT_CALLBACK]; 6 | } 7 | 8 | message MainMessage { 9 | optional SubMessage bar = 1 [(nanopb).type = FT_POINTER]; 10 | } 11 | 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/fuzztest/alltypes_static.options: -------------------------------------------------------------------------------- 1 | * max_size:32 2 | * max_count:8 3 | *.*fbytes fixed_length:true max_size:4 4 | *.*farray fixed_count:true max_count:5 5 | *.*farray2 fixed_count:true max_count:3 6 | *.DescriptorSize8 descriptorsize:DS_8 7 | *.IntSizes.*int8 int_size:IS_8 8 | *.IntSizes.*int16 int_size:IS_16 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_205/size_corruption.c: -------------------------------------------------------------------------------- 1 | #include "size_corruption.pb.h" 2 | #include 3 | 4 | int main() 5 | { 6 | MainMessage msg = MainMessage_init_zero; 7 | msg.bar_count = (pb_size_t)-1; 8 | pb_release(MainMessage_fields, &msg); 9 | 10 | return 0; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_256/submsg_array.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "nanopb.proto"; 3 | 4 | message SubMessage { 5 | repeated uint32 rep_uint32 = 1 [(nanopb).max_count = 3]; 6 | } 7 | 8 | message TestMessage { 9 | SubMessage submsg = 1 [(nanopb).proto3_singular_msgs = true]; 10 | } 11 | 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_363/oneofmsg.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "nanopb.proto"; 4 | 5 | message BodyMessage { 6 | oneof body_type { 7 | bytes device_data_crypted = 1 [(nanopb).max_size = 252]; 8 | bytes device_config_crypted = 2 [(nanopb).max_size = 252]; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_493/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #493: 2 | # Maximum recursion depth exceeded in generator 3 | 4 | Import("env") 5 | 6 | env.NanopbProto("test.proto") 7 | 8 | # Note that test.pb.c will fail compilation due to recursive static definition. 9 | # This is to be expected. 10 | 11 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_544/submsg_callback.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "nanopb.proto"; 4 | 5 | message SubMessage { 6 | required uint32 foo = 1; 7 | } 8 | 9 | message MyMessage { 10 | oneof oneof { 11 | SubMessage submsg = 1 [(nanopb).submsg_callback = true]; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_637/oneof.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "other.proto"; 4 | 5 | message FirstOneof {} 6 | 7 | message Bar { 8 | oneof content { 9 | FirstOneof first = 1; 10 | SecondOneof second = 2; 11 | } 12 | } 13 | 14 | message Foo { 15 | Bar bar = 1; 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/sort_by_tag/SConscript: -------------------------------------------------------------------------------- 1 | # Test sort_by_tag generator option 2 | 3 | Import("env") 4 | 5 | env.NanopbProto(["sort_by_tag.proto", "sort_by_tag.options"]) 6 | test = env.Program(["sort_by_tag.c", "sort_by_tag.pb.c", "$COMMON/pb_encode.o", "$COMMON/pb_decode.o", "$COMMON/pb_common.o"]) 7 | env.RunTest(test) 8 | 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/examples/cmake_relpath/proto/simple.proto: -------------------------------------------------------------------------------- 1 | // A very simple protocol definition, consisting of only 2 | // one message. 3 | syntax = "proto2"; 4 | 5 | import "sub/unlucky.proto"; 6 | 7 | message SimpleMessage { 8 | required int32 lucky_number = 1; 9 | required UnluckyNumber unlucky = 2; 10 | } 11 | 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/examples/platformio/src/test.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define TEST(x) \ 4 | if (!(x)) { \ 5 | fprintf(stderr, "\033[31;1mFAILED:\033[22;39m %s:%d %s\n", __FILE__, __LINE__, #x); \ 6 | status = 1; \ 7 | } else { \ 8 | printf("\033[32;1mOK:\033[22;39m %s\n", #x); \ 9 | } 10 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/alltypes_proto3_callback/alltypes.options: -------------------------------------------------------------------------------- 1 | # Generate all fields as callbacks. 2 | AllTypes.* type:FT_CALLBACK 3 | SubMessage.substuff1 max_size:16 4 | AllTypes.oneof no_unions:true 5 | 6 | # With FT_CALLBACK, these options should get ignored 7 | *.*fbytes fixed_length:true max_size:4 8 | 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_125/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for Issue 125: Wrong identifier name for extension fields 2 | 3 | Import("env") 4 | 5 | env.NanopbProto(["extensionbug", "extensionbug.options"]) 6 | env.Object('extensionbug.pb.c') 7 | 8 | env.Match(['extensionbug.pb.h', 'extensionbug.expected']) 9 | 10 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_610/nanopb_generator_bug/first.proto: -------------------------------------------------------------------------------- 1 | syntax="proto3"; 2 | 3 | import "nanopb_generator_bug/first/a.proto"; 4 | import "nanopb_generator_bug/first/b.proto"; 5 | 6 | message First { 7 | oneof oneof_first { 8 | first.A obj_a = 1; 9 | first.B obj_b = 2; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_692/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #693: 2 | # Duplicate declarations of size_unions with repeated fields inside a oneof 3 | 4 | Import("env") 5 | 6 | env.NanopbProto("other.proto") 7 | env.NanopbProto(["oneof.proto", "other.proto"]) 8 | env.Object("oneof.pb.c") 9 | env.Object("test.c") 10 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_380/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #380: 2 | # mangle_names:M_STRIP_PACKAGE is broken when message name (partially) 3 | # matches package name 4 | 5 | Import("env") 6 | 7 | env.NanopbProto(["manglenames.proto", "manglenames.options"]) 8 | env.Object("manglenames.pb.o", "manglenames.pb.c") 9 | 10 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_524/submessage.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package submessage; 4 | 5 | message SubMessage1 6 | { 7 | uint32 foo = 1; 8 | } 9 | 10 | message SubMessage2 11 | { 12 | uint32 foo = 1; 13 | } 14 | 15 | message SubMessage3 16 | { 17 | uint32 foo = 1; 18 | uint32 bar = 2; 19 | } 20 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/io_errors_pointers/alltypes.options: -------------------------------------------------------------------------------- 1 | # Generate all fields as pointers. 2 | * type:FT_POINTER 3 | *.*fbytes fixed_length:true max_size:4 4 | *.*farray fixed_count:true max_count:5 5 | *.*farray2 fixed_count:true max_count:3 6 | IntSizes.*int8 int_size:IS_8 7 | IntSizes.*int16 int_size:IS_16 8 | DescriptorSize8 descriptorsize:DS_8 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/missing_fields/SConscript: -------------------------------------------------------------------------------- 1 | # Check that the decoder properly detects when required fields are missing. 2 | 3 | Import("env") 4 | 5 | env.NanopbProto("missing_fields") 6 | test = env.Program(["missing_fields.c", "missing_fields.pb.c", "$COMMON/pb_encode.o", "$COMMON/pb_decode.o", "$COMMON/pb_common.o"]) 7 | env.RunTest(test) 8 | 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_380/manglenames.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | package A; 3 | 4 | message A { 5 | message B { 6 | optional uint32 val = 1; 7 | } 8 | optional B b = 1; 9 | } 10 | 11 | message AP { 12 | message B { 13 | optional uint32 val = 1; 14 | } 15 | optional B m = 1; 16 | } 17 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_407/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for issue #407: Extension fields > 255 not parsed correctly 2 | 3 | Import("env") 4 | 5 | env.NanopbProto("extensions") 6 | test = env.Program(["test_extensions.c", "extensions.pb.c", "$COMMON/pb_encode.o", "$COMMON/pb_decode.o", "$COMMON/pb_common.o"]) 7 | env.RunTest(test) 8 | 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_569/b.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "a.proto"; 4 | 5 | package b; 6 | 7 | message B { 8 | oneof data { 9 | a.AUnknown unknown = 1; 10 | int32 x = 2; 11 | } 12 | } 13 | 14 | message B2 { 15 | oneof data { 16 | a.AUnknown unknown = 1; 17 | a.A unknown2 = 2; 18 | } 19 | } -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_195/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for Issue 195: Message size not calculated if a submessage includes 2 | # bytes. Basically a non-working #define being generated. 3 | 4 | Import("env") 5 | 6 | env.NanopbProto(["test"]) 7 | env.Object('test.pb.c') 8 | 9 | env.Match(['test.pb.h', 'test.expected']) 10 | 11 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_610/nanopb_generator_bug/first/a.proto: -------------------------------------------------------------------------------- 1 | syntax="proto3"; 2 | 3 | package first; 4 | 5 | import "nanopb_generator_bug/first/a/aa.proto"; 6 | import "nanopb_generator_bug/first/a/ab.proto"; 7 | 8 | message A { 9 | oneof oneof_a { 10 | a.A obj_a = 1; 11 | a.B obj_b = 2; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/fuzztest/validation.h: -------------------------------------------------------------------------------- 1 | /* This module validates that the message structures are in valid state 2 | * after decoding the input data. */ 3 | 4 | #ifndef VALIDATION_H 5 | #define VALIDATION_H 6 | 7 | #include 8 | 9 | void validate_message(const void *msg, size_t structsize, const pb_msgdesc_t *msgtype); 10 | 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_407/extensions.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message SimpleMessage { 4 | optional uint32 number = 1; 5 | extensions 100 to max; 6 | } 7 | 8 | message ExtMessage { 9 | extend SimpleMessage { 10 | optional ExtMessage ext_message_ext = 1100; 11 | } 12 | optional uint32 second_number = 1; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_524/oneof.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "submessage.proto"; 4 | 5 | package mymessage; 6 | 7 | message MyMessage 8 | { 9 | oneof foo 10 | { 11 | submessage.SubMessage1 msg1 = 1; 12 | submessage.SubMessage2 msg2 = 2; 13 | submessage.SubMessage3 msg3 = 3; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/without_64bit/no_64bit_syshdr.h: -------------------------------------------------------------------------------- 1 | /* This wrapper undefines (u)int64_t */ 2 | 3 | #ifdef PB_OLD_SYSHDR 4 | #include PB_OLD_SYSHDR 5 | #else 6 | #include 7 | #include 8 | #include 9 | #include 10 | #endif 11 | 12 | #define uint64_t disabled_uint64_t 13 | #define int64_t disabled_int64_t 14 | 15 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_242/zero_value.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | import "nanopb.proto"; 3 | 4 | message Extendable { 5 | extensions 10 to 100; 6 | } 7 | 8 | extend Extendable { 9 | optional int32 opt_int32 = 11; 10 | } 11 | 12 | message PointerMessage { 13 | optional int32 opt_int32 = 11 [(nanopb).type = FT_POINTER]; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_125/extensionbug.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message Message1 4 | { 5 | optional uint32 fieldA = 1; 6 | extensions 30 to max; 7 | } 8 | 9 | message Message2 10 | { 11 | extend Message1 12 | { 13 | optional Message2 extras = 30; 14 | } 15 | 16 | optional uint32 field1 = 1; 17 | optional uint32 field2 = 2; 18 | } 19 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_166/enums.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | enum SignedEnum { 4 | SE_MIN = -1; 5 | SE_MAX = 255; 6 | } 7 | 8 | enum UnsignedEnum { 9 | UE_MAX = 65536; 10 | } 11 | 12 | message SignedMsg { 13 | required SignedEnum value = 1; 14 | } 15 | 16 | message UnsignedMsg { 17 | required UnsignedEnum value = 1; 18 | } 19 | -------------------------------------------------------------------------------- /Firmware/SongDataInternal.pb.c: -------------------------------------------------------------------------------- 1 | /* Automatically generated nanopb constant definitions */ 2 | /* Generated by nanopb-0.4.8-dev */ 3 | 4 | #include "SongDataInternal.pb.h" 5 | #if PB_PROTO_HEADER_VERSION != 40 6 | #error Regenerate this file with the current version of nanopb generator. 7 | #endif 8 | 9 | PB_BIND(SongDataInternal, SongDataInternal, AUTO) 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Firmware/nanopb/generator/protoc.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: This file acts as a drop-in replacement of binary protoc.exe. 3 | :: It will use either Python-based protoc from grpcio-tools package, 4 | :: or if it is not available, protoc.exe from path if found. 5 | 6 | setLocal enableDelayedExpansion 7 | set mydir=%~dp0 8 | python "%mydir%\protoc" %* 9 | exit /b %ERRORLEVEL% 10 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_558/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #558: 2 | # Manually defining proto3:true on a field with default value incorrectly omits it when encoding. 3 | 4 | Import("env") 5 | env.NanopbProto("mixed") 6 | 7 | test = env.Program(["mixed.c", "mixed.pb.c", "$COMMON/pb_encode.o", "$COMMON/pb_decode.o", "$COMMON/pb_common.o"]) 8 | env.RunTest(test) 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_617/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #617: 2 | # Unordered field numbers inside oneof can cause fields to be ignored 3 | 4 | Import("env") 5 | 6 | env.NanopbProto(["oneof.proto", "oneof.options"]) 7 | 8 | test = env.Program(["test_oneof.c", "oneof.pb.c", "$COMMON/pb_decode.o", "$COMMON/pb_common.o"]) 9 | env.RunTest(test) 10 | 11 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/special_characters/SConscript: -------------------------------------------------------------------------------- 1 | # Test that special characters in .proto filenames work. 2 | 3 | Import('env') 4 | 5 | env.NanopbProto(["funny-proto+name has.characters.proto", "funny-proto+name has.characters.options"]) 6 | env.Object("funny-proto+name has.characters.pb.c") 7 | env.Match(['funny-proto+name has.characters.pb.h', 'specchars.expected']) 8 | 9 | -------------------------------------------------------------------------------- /Firmware/GlobalDefines.h: -------------------------------------------------------------------------------- 1 | #define SAMPLES_PER_BLOCK 64 2 | #define BLOCKS_PER_SEND 4 3 | #define SAMPLES_PER_SEND SAMPLES_PER_BLOCK*BLOCKS_PER_SEND 4 | 5 | // 6mb * 0x40000 (file position start) 6 | // this includes the total space used up by other files (song data / sequence data) 7 | // this is approximately 90 seconds sample time 8 | #define MAX_RECORDED_SAMPLES_SIZE 6*1024*1024-0x40000 -------------------------------------------------------------------------------- /Firmware/nanopb/tests/message_sizes/SConscript: -------------------------------------------------------------------------------- 1 | # Test the generation of message size #defines 2 | 3 | Import('env') 4 | 5 | incpath = env.Clone() 6 | incpath.Append(PROTOCPATH = '#message_sizes') 7 | 8 | incpath.NanopbProto("messages1") 9 | incpath.NanopbProto("messages2") 10 | 11 | incpath.Program(['dummy.c', 'messages1.pb.c', 'messages2.pb.c', '$COMMON/pb_common.o']) 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/common/test_helpers.h: -------------------------------------------------------------------------------- 1 | /* Compatibility helpers for the test programs. */ 2 | 3 | #ifndef _TEST_HELPERS_H_ 4 | #define _TEST_HELPERS_H_ 5 | 6 | #ifdef _WIN32 7 | #include 8 | #include 9 | #define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) 10 | 11 | #else 12 | #define SET_BINARY_MODE(file) 13 | 14 | #endif 15 | 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_453/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #453: 2 | # Warning for float conversion with default values. 3 | 4 | Import("env") 5 | 6 | env2 = env.Clone() 7 | 8 | if 'gcc' in env['CC']: 9 | env2.Append(CFLAGS = '-Wconversion') 10 | 11 | env2.NanopbProto("test.proto") 12 | testprog = env2.Program(["test.c"]) 13 | env2.RunTest(testprog) 14 | 15 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/fuzztest/alltypes_pointer.options: -------------------------------------------------------------------------------- 1 | # Generate all fields as pointers. 2 | * type:FT_POINTER 3 | *.static_msg type:FT_STATIC 4 | *.*fbytes fixed_length:true max_size:4 5 | *.*farray fixed_count:true max_count:5 6 | *.*farray2 fixed_count:true max_count:3 7 | *.DescriptorSize8 descriptorsize:DS_8 8 | *.IntSizes.*int8 int_size:IS_8 9 | *.IntSizes.*int16 int_size:IS_16 10 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_544/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #544: 2 | # Decoding whole submessage in submessage callback causes "missing required field" 3 | 4 | Import("env") 5 | env.NanopbProto("submsg_callback") 6 | 7 | test = env.Program(["submsg_callback.c", "submsg_callback.pb.c", "$COMMON/pb_encode.o", "$COMMON/pb_decode.o", "$COMMON/pb_common.o"]) 8 | env.RunTest(test) 9 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/intsizes/SConscript: -------------------------------------------------------------------------------- 1 | # Test that the int_size option in .proto works. 2 | 3 | Import('env') 4 | 5 | env.NanopbProto('intsizes') 6 | 7 | p = env.Program(["intsizes_unittests.c", 8 | "intsizes.pb.c", 9 | "$COMMON/pb_encode.o", 10 | "$COMMON/pb_decode.o", 11 | "$COMMON/pb_common.o"]) 12 | env.RunTest(p) 13 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/namingstyle/SConscript: -------------------------------------------------------------------------------- 1 | # Test namingstyle option 2 | 3 | Import('env') 4 | 5 | env = env.Clone() 6 | env.Replace(NANOPBFLAGS = "-C") 7 | 8 | env.NanopbProto(["naming_style", "naming_style.options"]) 9 | 10 | test = env.Program(["test_naming_style_c.c", "naming_style.pb.c", "$COMMON/pb_decode.o", "$COMMON/pb_encode.o", '$COMMON/pb_common.o']) 11 | env.RunTest(test) 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_166/SConscript: -------------------------------------------------------------------------------- 1 | # Verify that the maximum encoded size is calculated properly 2 | # for enums. 3 | 4 | Import('env') 5 | 6 | env.NanopbProto('enums') 7 | 8 | p = env.Program(["enum_encoded_size.c", 9 | "enums.pb.c", 10 | "$COMMON/pb_encode.o", 11 | "$COMMON/pb_common.o"]) 12 | env.RunTest(p) 13 | 14 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_342/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #342: 2 | # Possible null-pointer dereference in pb_decode.c 3 | 4 | Import("env") 5 | 6 | env.NanopbProto("extensions") 7 | testprog = env.Program(["test_extensions.c", "extensions.pb.c", 8 | '$COMMON/pb_decode.o', '$COMMON/pb_encode.o', '$COMMON/pb_common.o']) 9 | 10 | env.RunTest(testprog) 11 | 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_472/test.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "nanopb.proto"; 4 | 5 | message FirmwareUpdateCommand { 6 | string version = 1; 7 | uint32 size = 2; 8 | } 9 | 10 | message CommandWrapperMessage { 11 | option (nanopb_msgopt).submsg_callback = true; 12 | 13 | oneof payload { 14 | FirmwareUpdateCommand firmware_update = 1; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_524/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #524: 2 | # Generator fails to find dependencies from another package namespace 3 | 4 | Import('env') 5 | 6 | env.NanopbProto("submessage.proto") 7 | env.NanopbProto("oneof.proto") 8 | env.Depends("oneof.pb.c", "submessage.proto") 9 | env.Object("oneof.pb.c") 10 | env.Match(["oneof.pb.h", "oneof.expected"]) 11 | 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/common/malloc_wrappers.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void* malloc_with_check(size_t size); 4 | void free_with_check(void *mem); 5 | void* realloc_with_check(void *ptr, size_t size); 6 | size_t get_alloc_count(); 7 | size_t get_allocation_size(const void *mem); 8 | size_t get_alloc_bytes(); 9 | void set_max_alloc_bytes(size_t max_bytes); 10 | size_t get_max_alloc_bytes(); 11 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/enum_mapping/enum_mapping.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | enum TestEnum1 4 | { 5 | A = 0; 6 | B = 2; 7 | C = -3; 8 | } 9 | 10 | enum TestEnum2 11 | { 12 | X = 0; 13 | Y = 5; 14 | } 15 | 16 | message TestMsg 17 | { 18 | TestEnum1 test1 = 1; 19 | 20 | oneof oneof1 21 | { 22 | TestEnum2 test2 = 2; 23 | } 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_322/SConscript: -------------------------------------------------------------------------------- 1 | # Check that default values with special characters are 2 | # correctly handled. 3 | 4 | Import('env') 5 | 6 | env.NanopbProto('defaults') 7 | 8 | p = env.Program(["defaults.c", 9 | "defaults.pb.c", 10 | "$COMMON/pb_decode.o", 11 | "$COMMON/pb_common.o"]) 12 | 13 | env.RunTest(p) 14 | 15 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/comments/comments.expected: -------------------------------------------------------------------------------- 1 | Enum1Comment 2 | LeadingEnumComment 3 | ENUMVAL2.*TrailingEnumComment 4 | Message1Comment 5 | member2.*TrailingMemberComment 6 | m2member1.*m2comment1 7 | m2member50.*m2comment50 8 | m2member4.*m2comment4 9 | m2oneof10.*m2oneof10_comment 10 | m2oneof5.*m2oneof5_comment 11 | A.*A_comment 12 | B.*B_comment 13 | C.*C_comment 14 | subfield.*subfield_comment 15 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_118/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for Issue 118: Short enum names in imported proto files are not honoured 2 | 3 | Import("env") 4 | env = env.Clone() 5 | env.Append(PROTOCPATH = "#regression/issue_118") 6 | 7 | env.NanopbProto("enumdef") 8 | env.Object('enumdef.pb.c') 9 | 10 | env.NanopbProto(["enumuse", "enumdef.proto"]) 11 | env.Object('enumuse.pb.c') 12 | 13 | -------------------------------------------------------------------------------- /Firmware/diagnostics.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "hardware.h" 3 | #include "ws2812.h" 4 | #include "m6x118pt7b.h" 5 | #include 6 | 7 | 8 | class Diagnostics 9 | { 10 | public: 11 | void run(); 12 | void flashQuickClear(); 13 | private: 14 | void buttonTest(); 15 | uint32_t color[25]; 16 | uint32_t keyState = 0; 17 | uint32_t lastKeyState = 0; 18 | char str[64]; 19 | }; -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_487/test.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | package a.b.c; 3 | 4 | message TopLevel { 5 | optional uint32 field = 1 [default = 0]; 6 | optional NestedTypeA foo = 2; 7 | 8 | message NestedTypeA { 9 | optional NestedTypeB bar = 1; 10 | 11 | message NestedTypeB { 12 | optional uint32 foobar = 1; 13 | } 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/alltypes_callback/alltypes.options: -------------------------------------------------------------------------------- 1 | # Generate all fields as callbacks. 2 | AllTypes.* type:FT_CALLBACK 3 | SubMessage.substuff1 max_size:16 4 | AllTypes.oneof no_unions:true 5 | DescriptorSize8 descriptorsize:DS_8 6 | 7 | # With FT_CALLBACK, these options should get ignored 8 | *.*fbytes fixed_length:true max_size:4 9 | *.*farray fixed_count:true max_count:5 10 | 11 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_227/unaligned_uint64.c: -------------------------------------------------------------------------------- 1 | #include "unaligned_uint64.pb.h" 2 | #include 3 | 4 | int main() 5 | { 6 | uint8_t buf[128]; 7 | pb_ostream_t stream = pb_ostream_from_buffer(buf, sizeof(buf)); 8 | MainMessage msg = MainMessage_init_zero; 9 | msg.bar[0] = 'A'; 10 | pb_encode(&stream, MainMessage_fields, &msg); 11 | 12 | return 0; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_247/SConscript: -------------------------------------------------------------------------------- 1 | # Test that pb_check_proto3_default_value() correctly skips padding 2 | # bytes in submessage structures. 3 | 4 | Import("env") 5 | 6 | env.NanopbProto("padding") 7 | 8 | p = env.Program(["padding.c", 9 | "padding.pb.c", 10 | "$COMMON/pb_encode.o", 11 | "$COMMON/pb_common.o"]) 12 | 13 | env.RunTest(p) 14 | 15 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_249/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for Issue 249: proto3 mode pb_decode() corrupts callback fields 2 | Import('env') 3 | 4 | env.NanopbProto('test') 5 | 6 | p = env.Program(["test.c", 7 | "test.pb.c", 8 | "$COMMON/pb_decode.o", 9 | "$COMMON/pb_encode.o", 10 | "$COMMON/pb_common.o"]) 11 | env.RunTest(p) 12 | 13 | -------------------------------------------------------------------------------- /Firmware/nanopb/examples/conan_dependency/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.20) 2 | project(simple C) 3 | 4 | include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) 5 | conan_basic_setup() 6 | 7 | add_library(simple-protos STATIC 8 | ${CMAKE_BINARY_DIR}/src/simple.pb.c 9 | ) 10 | 11 | add_executable(simple ${CMAKE_BINARY_DIR}/src/simple.c) 12 | 13 | target_link_libraries(simple ${CONAN_LIBS} simple-protos) 14 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/raw_decode/SConscript: -------------------------------------------------------------------------------- 1 | # This builds a simple utility that decodes a binary protobuf message. 2 | # It is similar to protoc --decode_raw, except it produces useful information 3 | # even for corrupted messages. 4 | 5 | Import("env") 6 | 7 | dec = env.Program(["raw_decode.c", "$COMMON/pb_decode.o", "$COMMON/pb_common.o"]) 8 | 9 | env.RunTest([dec, "$BUILD/alltypes/encode_alltypes.output"]) 10 | 11 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_203/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for issue with multiple files generated at once 2 | 3 | Import('env') 4 | env = env.Clone() 5 | env.Replace(NANOPBFLAGS = "--strip-path") 6 | env.Command(['file1.pb.c', 'file1.pb.h', 'file2.pb.c', 'file2.pb.h'], ['file1.proto', 'file2.proto'], 7 | env['NANOPB_PROTO_CMD']) 8 | 9 | env.Object('file1.pb.c') 10 | env.Object('file2.pb.c') 11 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/enum_sizes/SConscript: -------------------------------------------------------------------------------- 1 | # Test that different sizes of enum fields are properly encoded and decoded. 2 | 3 | Import('env') 4 | 5 | env.NanopbProto('enumsizes') 6 | 7 | p = env.Program(["enumsizes_unittests.c", 8 | "enumsizes.pb.c", 9 | "$COMMON/pb_encode.o", 10 | "$COMMON/pb_decode.o", 11 | "$COMMON/pb_common.o"]) 12 | env.RunTest(p) 13 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/cyclic_messages/SConscript: -------------------------------------------------------------------------------- 1 | Import("env") 2 | 3 | # Encode cyclic messages with callback fields 4 | 5 | c = Copy("$TARGET", "$SOURCE") 6 | env.Command("cyclic_callback.proto", "cyclic.proto", c) 7 | env.NanopbProto(["cyclic_callback", "cyclic_callback.options"]) 8 | 9 | enc_callback = env.Program(["encode_cyclic_callback.c", "cyclic_callback.pb.c", "$COMMON/pb_encode.o", "$COMMON/pb_common.o"]) 10 | 11 | 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/enum_to_string/enum.proto: -------------------------------------------------------------------------------- 1 | /* Test enum to string function generation */ 2 | 3 | syntax = "proto2"; 4 | 5 | import "nanopb.proto"; 6 | 7 | option (nanopb_fileopt).enum_to_string = true; 8 | 9 | enum MyEnum { 10 | VALUE1 = 1; 11 | VALUE2 = 2; 12 | VALUE15 = 15; 13 | } 14 | 15 | enum MyShortNameEnum { 16 | option (nanopb_enumopt).long_names = false; 17 | MSNE_VALUE256 = 256; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_631/test.c: -------------------------------------------------------------------------------- 1 | #include "submsg_callback.pb.h" 2 | 3 | SubMsg1 submsg1_zero = SubMsg1_init_zero; 4 | SubMsg1 submsg1_def = SubMsg1_init_default; 5 | SubMsg2 submsg2_zero = SubMsg2_init_zero; 6 | SubMsg2 submsg2_def = SubMsg2_init_default; 7 | SubMsgCB submsgcb_zero = SubMsgCB_init_zero; 8 | SubMsgCB submsgcb_def = SubMsgCB_init_default; 9 | 10 | int main() 11 | { 12 | return 0; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/alltypes_pointer/alltypes.options: -------------------------------------------------------------------------------- 1 | # Generate all fields as pointers. 2 | * type:FT_POINTER 3 | *.static_msg type:FT_STATIC 4 | SubMessage.substuff1 type:FT_STATIC max_size:8 5 | *.*fbytes fixed_length:true max_size:4 6 | *.*farray fixed_count:true max_count:5 7 | *.*farray2 fixed_count:true max_count:3 8 | IntSizes.*int8 int_size:IS_8 9 | IntSizes.*int16 int_size:IS_16 10 | DescriptorSize8 descriptorsize:DS_8 11 | 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_838/enum.proto: -------------------------------------------------------------------------------- 1 | /* Test enum to string function generation */ 2 | 3 | syntax = "proto2"; 4 | 5 | import "nanopb.proto"; 6 | 7 | option (nanopb_fileopt).enum_to_string = true; 8 | 9 | enum MyEnum { 10 | VALUE1 = 1; 11 | VALUE2 = 2; 12 | VALUE15 = 15; 13 | } 14 | 15 | enum MyShortNameEnum { 16 | option (nanopb_enumopt).long_names = false; 17 | MSNE_VALUE256 = 256; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_253/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for Issue 253: Wrong calculated message maximum size 2 | 3 | Import('env') 4 | 5 | env.NanopbProto('short_array') 6 | 7 | p = env.Program(['short_array.c', 8 | 'short_array.pb.c', 9 | "$COMMON/pb_decode.o", 10 | "$COMMON/pb_encode.o", 11 | "$COMMON/pb_common.o"]) 12 | 13 | env.RunTest(p) 14 | 15 | 16 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_504/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #504: 2 | # Non empty submessage considered empty on FT_POINTER fields with address aligned on 0x100 3 | 4 | Import('env', 'malloc_env') 5 | 6 | env.NanopbProto(["test.proto"]) 7 | test = malloc_env.Program(["test.c", 8 | "test.pb.c", 9 | "$COMMON/pb_encode.o", 10 | "$COMMON/pb_common.o"]) 11 | 12 | env.RunTest(test) 13 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_504/test.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "nanopb.proto"; 4 | 5 | message MyMessage 6 | { 7 | SubMessage submessage = 1 [(nanopb).proto3_singular_msgs = true]; 8 | } 9 | 10 | message SubMessage 11 | { 12 | string somestring = 1 [(nanopb).type = FT_POINTER]; 13 | SubMessage2 submsg2 = 2 [(nanopb).type = FT_POINTER]; 14 | } 15 | 16 | message SubMessage2 17 | { 18 | uint32 foo = 1; 19 | } -------------------------------------------------------------------------------- /Firmware/nanopb/tests/docker_images/README.md: -------------------------------------------------------------------------------- 1 | Docker files 2 | ------------ 3 | 4 | This folder contains docker files that are used in testing nanopb automatically 5 | on various platforms. 6 | 7 | By default they take the newest master branch code from github. 8 | 9 | To build tests for a single target, use for example: 10 | 11 | docker build ubuntu1804 12 | 13 | To build tests for all targets, use: 14 | 15 | ./build_all.sh 16 | 17 | 18 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/sort_by_tag/sort_by_tag.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | message Unsorted 4 | { 5 | uint32 first = 99; 6 | oneof oneof { 7 | uint32 second = 80; 8 | uint32 third = 50; 9 | } 10 | uint32 last = 1; 11 | } 12 | 13 | message Sorted 14 | { 15 | uint32 first = 99; 16 | oneof oneof { 17 | uint32 second = 80; 18 | uint32 third = 50; 19 | } 20 | uint32 last = 1; 21 | } 22 | -------------------------------------------------------------------------------- /Firmware/nanopb/generator/protoc-gen-nanopb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # This file is used to invoke nanopb_generator.py as a plugin 3 | # to protoc on Linux and other *nix-style systems. 4 | # Use it like this: 5 | # protoc --plugin=protoc-gen-nanopb=..../protoc-gen-nanopb --nanopb_out=dir foo.proto 6 | 7 | from nanopb_generator import * 8 | 9 | if __name__ == '__main__': 10 | # Assume we are running as a plugin under protoc. 11 | main_plugin() 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/cxx_callback_datatype/message.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "nanopb.proto"; 4 | 5 | option(nanopb_fileopt).include = ''; 6 | 7 | message SubMessage { 8 | sint32 actual_value = 1; 9 | } 10 | 11 | message TestMessage { 12 | // Instead of std::vector callback handles wrapping/unwrapping of the int. 13 | repeated SubMessage submessages = 1 [(nanopb).callback_datatype = "std::vector"]; 14 | } 15 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/enum_minmax/enumminmax_unittests.c: -------------------------------------------------------------------------------- 1 | #include "unittests.h" 2 | #include "enumminmax.pb.h" 3 | 4 | int main() 5 | { 6 | int status = 0; 7 | 8 | COMMENT("Verify min/max on unsorted enum"); 9 | { 10 | TEST(_Language_MIN == Language_UNKNOWN); 11 | TEST(_Language_MAX == Language_SPANISH_ES_MX); 12 | TEST(_Language_ARRAYSIZE == (Language_SPANISH_ES_MX+1)); 13 | } 14 | 15 | return status; 16 | } 17 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_395/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #395: 2 | # Unexpected empty submessage in proto3 mode 3 | 4 | Import("env") 5 | 6 | env.NanopbProto(["test.proto", "test.options"]) 7 | testprog = env.Program(["test.c", 8 | "test.pb.c", 9 | "$COMMON/pb_encode.o", 10 | "$COMMON/pb_decode.o", 11 | "$COMMON/pb_common.o"]) 12 | 13 | env.RunTest(testprog) 14 | 15 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/options/proto3_options.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "nanopb.proto"; 4 | 5 | message SubMsg 6 | { 7 | int32 field = 1; 8 | } 9 | 10 | message Message1 11 | { 12 | int32 proto3_default = 1; 13 | int32 proto3_off = 2 [(nanopb).proto3 = false]; 14 | int32 proto3_on = 3 [(nanopb).proto3 = true]; 15 | SubMsg normal_submsg = 4; 16 | SubMsg sng_submsg = 5 [(nanopb).proto3_singular_msgs = true]; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_229/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for Issue 229: problem encoding message that has 2 | # multiple oneof fields 3 | Import('env') 4 | 5 | env.NanopbProto('multiple_oneof') 6 | 7 | p = env.Program(["multiple_oneof.c", 8 | "multiple_oneof.pb.c", 9 | "$COMMON/pb_decode.o", 10 | "$COMMON/pb_encode.o", 11 | "$COMMON/pb_common.o"]) 12 | env.RunTest(p) 13 | 14 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_242/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for Issue 242: pb_encode does not encode tag for 2 | # extension fields that is all zeros 3 | Import('env') 4 | 5 | env.NanopbProto('zero_value') 6 | 7 | p = env.Program(["zero_value.c", 8 | "zero_value.pb.c", 9 | "$COMMON/pb_decode.o", 10 | "$COMMON/pb_encode.o", 11 | "$COMMON/pb_common.o"]) 12 | env.RunTest(p) 13 | 14 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_363/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #363: 2 | # Incorrect PB_STATIC_ASSERT for bytes inside oneof 3 | 4 | Import("env") 5 | 6 | env.NanopbProto("oneofmsg.proto") 7 | testprog = env.Program(["test_oneofmsg.c", 8 | "oneofmsg.pb.c", 9 | "$COMMON/pb_encode.o", 10 | "$COMMON/pb_decode.o", 11 | "$COMMON/pb_common.o"]) 12 | 13 | env.RunTest(testprog) 14 | 15 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/inline/SConscript: -------------------------------------------------------------------------------- 1 | # Test that inlined bytes fields work. 2 | 3 | Import("env") 4 | 5 | env.NanopbProto("inline") 6 | env.Object("inline.pb.c") 7 | 8 | env.Match(["inline.pb.h", "inline.expected"]) 9 | 10 | p = env.Program(["inline_unittests.c", 11 | "inline.pb.c", 12 | "$COMMON/pb_encode.o", 13 | "$COMMON/pb_decode.o", 14 | "$COMMON/pb_common.o"]) 15 | 16 | env.RunTest(p) 17 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_569/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #569: 2 | # Compilation error when dependent message size is not defined. 3 | 4 | Import("env") 5 | 6 | # For C compiler 7 | env.NanopbProto("a") 8 | env.NanopbProto("b") 9 | env.Object("a.pb.c") 10 | env.Object("b.pb.c") 11 | 12 | # For C++ compiler 13 | env.NanopbProtoCpp("a") 14 | env.NanopbProtoCpp("b") 15 | env.Object("a_cpp.o", "a.pb.cpp") 16 | env.Object("b_cpp.o", "b.pb.cpp") 17 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/common/malloc_wrappers_syshdr.h: -------------------------------------------------------------------------------- 1 | /* This is just a wrapper in order to get our own malloc wrappers into nanopb core. */ 2 | 3 | #define pb_realloc(ptr,size) realloc_with_check(ptr,size) 4 | #define pb_free(ptr) free_with_check(ptr) 5 | 6 | #ifdef PB_OLD_SYSHDR 7 | #include PB_OLD_SYSHDR 8 | #else 9 | #include 10 | #include 11 | #include 12 | #include 13 | #endif 14 | 15 | #include 16 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/inline/inline.proto: -------------------------------------------------------------------------------- 1 | /* Test nanopb option parsing. 2 | * options.expected lists the patterns that are searched for in the output. 3 | */ 4 | 5 | syntax = "proto2"; 6 | 7 | import "nanopb.proto"; 8 | 9 | message Message1 10 | { 11 | required bytes data = 1 [(nanopb).type = FT_INLINE, (nanopb).max_size = 32]; 12 | } 13 | 14 | message Message2 15 | { 16 | optional bytes data = 1 [(nanopb).type = FT_INLINE, (nanopb).max_size = 64]; 17 | } 18 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_647/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #647: 2 | # Ill-formed oneof message leads to calling free on an arbitrary pointer 3 | 4 | Import("env") 5 | 6 | env.NanopbProto("repro.proto") 7 | 8 | test = env.Program(["repro.c", "repro.pb.c", 9 | "$COMMON/pb_decode_with_malloc.o", 10 | "$COMMON/pb_common_with_malloc.o", 11 | "$COMMON/malloc_wrappers.o"]) 12 | env.RunTest(test) 13 | -------------------------------------------------------------------------------- /Firmware/nanopb/examples/network_server/Makefile: -------------------------------------------------------------------------------- 1 | # Include the nanopb provided Makefile rules 2 | include ../../extra/nanopb.mk 3 | 4 | # Compiler flags to enable all warnings & debug info 5 | CFLAGS = -ansi -Wall -Werror -g -O0 6 | CFLAGS += -I$(NANOPB_DIR) 7 | 8 | all: server client 9 | 10 | .SUFFIXES: 11 | 12 | clean: 13 | rm -f server client fileproto.pb.c fileproto.pb.h 14 | 15 | %: %.c common.c fileproto.pb.c 16 | $(CC) $(CFLAGS) -o $@ $^ $(NANOPB_CORE) 17 | 18 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/docker_images/ubuntu1804/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:bionic 2 | 3 | RUN apt -y update 4 | RUN apt -y upgrade 5 | RUN apt -y dist-upgrade 6 | RUN apt -y autoremove 7 | RUN apt -y install --fix-missing 8 | RUN apt -y install apt-utils 9 | 10 | RUN apt -y install git scons build-essential g++ 11 | RUN apt -y install protobuf-compiler python3-protobuf python3 12 | 13 | RUN git clone https://github.com/nanopb/nanopb.git 14 | RUN cd nanopb/tests && scons 15 | 16 | -------------------------------------------------------------------------------- /Firmware/nanopb/extra/nanopb-config-version.cmake.in: -------------------------------------------------------------------------------- 1 | set(PACKAGE_VERSION "@nanopb_VERSION@") 2 | 3 | # Check whether the requested PACKAGE_FIND_VERSION is compatible 4 | if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") 5 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 6 | else() 7 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 8 | if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") 9 | set(PACKAGE_VERSION_EXACT TRUE) 10 | endif() 11 | endif() 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/mem_release/SConscript: -------------------------------------------------------------------------------- 1 | Import("env", "malloc_env") 2 | 3 | env.NanopbProto("mem_release.proto") 4 | 5 | test = malloc_env.Program(["mem_release.c", 6 | "mem_release.pb.c", 7 | "$COMMON/pb_encode_with_malloc.o", 8 | "$COMMON/pb_decode_with_malloc.o", 9 | "$COMMON/pb_common_with_malloc.o", 10 | "$COMMON/malloc_wrappers.o"]) 11 | 12 | env.RunTest(test) 13 | 14 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_376/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #376: 2 | # Problem with fixed array inside proto3 submessage 3 | 4 | Import("env") 5 | 6 | env.NanopbProto(["fixed_array.proto", "fixed_array.options"]) 7 | testprog = env.Program(["test_fixarray.c", 8 | "fixed_array.pb.c", 9 | "$COMMON/pb_encode.o", 10 | "$COMMON/pb_decode.o", 11 | "$COMMON/pb_common.o"]) 12 | 13 | env.RunTest(testprog) 14 | 15 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_692/oneof.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "other.proto"; 4 | 5 | message FirstOneof {} 6 | 7 | message Bar { 8 | oneof content { 9 | FirstOneof first = 1; 10 | SecondOneof second = 2; // unknown size if no options are considered 11 | } 12 | } 13 | 14 | message Foo { 15 | AnotherList foo = 1; // again, unknown size 16 | Bar bar = 2; // no duplicate size_union shall be generated anymore 17 | } 18 | 19 | 20 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/backwards_compatibility/SConscript: -------------------------------------------------------------------------------- 1 | # Check that the old generated .pb.c/.pb.h files are still compatible with the 2 | # current version of nanopb. 3 | 4 | Import("env") 5 | 6 | enc = env.Program(["encode_legacy.c", "alltypes_legacy.c", "$COMMON/pb_encode.o", "$COMMON/pb_common.o"]) 7 | dec = env.Program(["decode_legacy.c", "alltypes_legacy.c", "$COMMON/pb_decode.o", "$COMMON/pb_common.o"]) 8 | 9 | env.RunTest(enc) 10 | env.RunTest([dec, "encode_legacy.output"]) 11 | 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_256/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for Issue 256: Proto3 mode skips submessages even when 2 | # later array fields have non-zero value 3 | 4 | Import('env') 5 | 6 | env.NanopbProto('submsg_array') 7 | 8 | p = env.Program(['submsg_array.c', 9 | 'submsg_array.pb.c', 10 | "$COMMON/pb_decode.o", 11 | "$COMMON/pb_encode.o", 12 | "$COMMON/pb_common.o"]) 13 | 14 | env.RunTest(p) 15 | 16 | 17 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_647/repro.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "repro.pb.h" 5 | 6 | int main() { 7 | const uint8_t data[] = {0x08, 0x08, 0x2d}; 8 | int status = 0; 9 | Repro repro = Repro_init_zero; 10 | 11 | pb_istream_t stream = pb_istream_from_buffer(data, sizeof(data)); 12 | TEST(!pb_decode(&stream, Repro_fields, &repro)); 13 | TEST(get_alloc_count() == 0); 14 | 15 | return status; 16 | } 17 | -------------------------------------------------------------------------------- /Firmware/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "build", 8 | "type": "cmake", 9 | "command": "build", 10 | "problemMatcher": [], 11 | "group": { 12 | "kind": "build", 13 | "isDefault": true 14 | } 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /Firmware/nanopb/extra/bazel/nanopb_workspace.bzl: -------------------------------------------------------------------------------- 1 | load("@nanopb_pypi//:requirements.bzl", "install_deps") 2 | load("@rules_proto_grpc//:repositories.bzl", "rules_proto_grpc_repos", "rules_proto_grpc_toolchains") 3 | load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") 4 | 5 | def nanopb_workspace(): 6 | install_deps() 7 | rules_proto_grpc_toolchains() 8 | rules_proto_grpc_repos() 9 | rules_proto_dependencies() 10 | rules_proto_toolchains() 11 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/msgid/msgid_example.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "nanopb.proto"; 4 | 5 | message MyMessage1 6 | { 7 | option (nanopb_msgopt).msgid = 1; 8 | 9 | int32 intvalue = 1; 10 | } 11 | 12 | message MyMessage2 13 | { 14 | option (nanopb_msgopt).msgid = 2; 15 | 16 | int32 intvalue = 1; 17 | string strvalue = 2 [(nanopb).max_size = 16]; 18 | } 19 | 20 | message MyMessage3 21 | { 22 | option (nanopb_msgopt).msgid = 3; 23 | 24 | bool boolvalue = 1; 25 | } 26 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_322/defaults.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | import 'nanopb.proto'; 3 | 4 | message DefaultsMsg { 5 | optional bytes b1 = 1 [default = "\xDE\xAD\x00\xBE\xEF", (nanopb).max_size = 5, (nanopb).fixed_length=true]; 6 | optional bytes b2 = 2 [default = "\xDE\xAD\x00\xBE\xEF", (nanopb).max_size = 5]; 7 | optional bytes b3 = 3 [default = "\xDE\xAD\000\xBE\xEF", (nanopb).max_size = 15]; 8 | optional string s1 = 4 [default = "äö", (nanopb).max_size = 8]; 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_522/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #522: 2 | # Compile Errors when using UENUM on atmega32u4 3 | 4 | Import('env') 5 | 6 | env2 = env.Clone() 7 | env2.Append(CPPDEFINES = {'UENUM': '_SFR_MEM8', 'BOOL': 'foobar_bool_t', 8 | 'INT32': '1234', 'OPTIONAL': 'xyz_t', 9 | 'REPEATED': '0', 'STATIC': 'static', 10 | 'CALLBACK': '9999'}) 11 | env2.NanopbProto("uenum.proto") 12 | env2.Object(["uenum.pb.c"]) 13 | 14 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_795/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for issue #795: 2 | # "Lookup of non-absolute type names is not supported" when using 3 | # mangle_names:M_STRIP_PACKAGE 4 | 5 | Import('env') 6 | 7 | opts = env.Clone() 8 | 9 | opts.Append(NANOPBFLAGS = "-s mangle_names=M_STRIP_PACKAGE") 10 | 11 | opts.NanopbProto("test.proto") 12 | opts.NanopbProto("test2.proto") 13 | opts.NanopbProto("test3.proto") 14 | opts.Object("test.pb.c") 15 | opts.Object("test2.pb.c") 16 | opts.Object("test3.pb.c") 17 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/site_scons/platforms/mips/mips.py: -------------------------------------------------------------------------------- 1 | # Compiler settings for running the tests on mips-linux-gnu (big endian) 2 | # using qemu. Requires following packages to be installed: 3 | # gcc-mips-linux-gnu g++-mips-linux-gnu qemu-user 4 | 5 | def set_mips_platform(env): 6 | env.Replace(EMBEDDED = "MIPS") 7 | env.Replace(CC = "mips-linux-gnu-gcc", 8 | CXX = "mips-linux-gnu-g++") 9 | env.Replace(TEST_RUNNER = "/usr/bin/qemu-mips") 10 | env.Append(LINKFLAGS = "-static") 11 | 12 | -------------------------------------------------------------------------------- /WebEditor/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Bitsyn Song Backup 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 |
17 | 18 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/site_scons/platforms/mipsel/mipsel.py: -------------------------------------------------------------------------------- 1 | # Compiler settings for running the tests on mipsel-linux-gnu using 2 | # qemu. Requires following packages to be installed: 3 | # gcc-mipsel-linux-gnu g++-mipsel-linux-gnu qemu-user 4 | 5 | def set_mipsel_platform(env): 6 | env.Replace(EMBEDDED = "MIPSEL") 7 | env.Replace(CC = "mipsel-linux-gnu-gcc", 8 | CXX = "mipsel-linux-gnu-g++") 9 | env.Replace(TEST_RUNNER = "/usr/bin/qemu-mipsel") 10 | env.Append(LINKFLAGS = "-static") 11 | 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/.github/workflows/ios_swift_tests.yml: -------------------------------------------------------------------------------- 1 | name: Build and test for Apple iOS swift 2 | 3 | on: 4 | workflow_dispatch: 5 | workflow_call: 6 | push: 7 | paths: 8 | - '**spm**' 9 | - '**swift**' 10 | pull_request: 11 | paths: 12 | - '**spm**' 13 | - '**swift**' 14 | 15 | jobs: 16 | swift-build-run: 17 | runs-on: macOS-latest 18 | steps: 19 | - uses: actions/checkout@v2 20 | - name: Build 21 | run: swift build 22 | - name: Run 23 | run: swift test 24 | -------------------------------------------------------------------------------- /Firmware/nanopb/examples/cmake_simple/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | project(NANOPB_CMAKE_SIMPLE C) 3 | 4 | set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../extra) 5 | find_package(Nanopb REQUIRED) 6 | include_directories(${NANOPB_INCLUDE_DIRS}) 7 | 8 | nanopb_generate_cpp(PROTO_SRCS PROTO_HDRS simple.proto) 9 | include_directories(${CMAKE_CURRENT_BINARY_DIR}) 10 | 11 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -g -O0") 12 | 13 | add_executable(simple simple.c ${PROTO_SRCS} ${PROTO_HDRS}) 14 | -------------------------------------------------------------------------------- /Firmware/tlv320driver.h: -------------------------------------------------------------------------------- 1 | #ifndef TLV320DRIVER_H 2 | #define TLV320DRIVER_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | #include "pico/stdlib.h" 9 | #include "hardware/i2c.h" 10 | 11 | void tlvDriverInit(); 12 | bool readRegister(uint8_t page, uint8_t reg, uint8_t *rxdata); 13 | void driver_set_mic(bool mic_state); 14 | void driver_set_mute(bool mute); 15 | void driver_set_hpvol(int8_t hpvol); 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | 21 | #endif /* TLV320DRIVER_H */ -------------------------------------------------------------------------------- /Firmware/audio/small_stmlib.h: -------------------------------------------------------------------------------- 1 | #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ 2 | TypeName(const TypeName&); \ 3 | void operator=(const TypeName&) 4 | 5 | #define CLIP(x) if (x < -32767) x = -32767; if (x > 32767) x = 32767; 6 | 7 | #define CONSTRAIN(var, min, max) \ 8 | if (var < (min)) { \ 9 | var = (min); \ 10 | } else if (var > (max)) { \ 11 | var = (max); \ 12 | } 13 | 14 | 15 | #define JOIN(lhs, rhs) JOIN_1(lhs, rhs) 16 | #define JOIN_1(lhs, rhs) JOIN_2(lhs, rhs) 17 | #define JOIN_2(lhs, rhs) lhs##rhs -------------------------------------------------------------------------------- /Firmware/nanopb/generator/protoc-gen-nanopb.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: This file is used to invoke nanopb_generator.py as a plugin 3 | :: to protoc on Windows. 4 | :: Use it like this: 5 | :: protoc --plugin=protoc-gen-nanopb=..../protoc-gen-nanopb.bat --nanopb_out=dir foo.proto 6 | :: 7 | :: Note that if you use the binary package of nanopb, the protoc 8 | :: path is already set up properly and there is no need to give 9 | :: --plugin= on the command line. 10 | 11 | set mydir=%~dp0 12 | python "%mydir%\nanopb_generator.py" --protoc-plugin %* 13 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/io_errors/SConscript: -------------------------------------------------------------------------------- 1 | # Simulate io errors when encoding and decoding 2 | 3 | Import("env") 4 | 5 | c = Copy("$TARGET", "$SOURCE") 6 | env.Command("alltypes.proto", "#alltypes/alltypes.proto", c) 7 | 8 | env.NanopbProto(["alltypes", "alltypes.options"]) 9 | 10 | ioerr = env.Program(["io_errors.c", "alltypes.pb.c", 11 | "$COMMON/pb_encode.o", "$COMMON/pb_decode.o", "$COMMON/pb_common.o"]) 12 | 13 | env.RunTest("io_errors.output", [ioerr, "$BUILD/alltypes/encode_alltypes.output"]) 14 | 15 | 16 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_611/uenum.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | enum my_enum { 4 | E0 = 0; 5 | E240 = 240; 6 | E1 = -1; 7 | } 8 | 9 | enum my_uenum { 10 | U0 = 0; 11 | U240 = 240; 12 | } 13 | 14 | message my_message_regular { 15 | required my_enum MyEnum = 1; 16 | required my_uenum MyUEnum = 2; 17 | } 18 | 19 | message my_message_oneof { 20 | required uint32 Data1 = 1; 21 | oneof Data { 22 | bool null = 2; 23 | my_enum MyEnum = 3; 24 | my_uenum MyUEnum = 4; 25 | } 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_746/test.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; // must be "proto2", proto3 requires enums starting with 0. 2 | 3 | enum Enum 4 | { 5 | enumerand = 1; // must be non-zero 6 | } 7 | 8 | message Outer1 9 | { 10 | message Inner 11 | { 12 | optional Enum enum1 = 1; // can also be "required" 13 | } 14 | } 15 | 16 | message Outer2 17 | { 18 | message Inner 19 | { 20 | // further trouble of this is also named "enum1" 21 | optional Enum enum2 = 1; // can also be "required" 22 | 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/site_scons/platforms/riscv64/riscv64.py: -------------------------------------------------------------------------------- 1 | # Compiler settings for running the tests on riscv64-linux-gnu 2 | # using qemu. Requires following packages to be installed: 3 | # gcc-riscv64-linux-gnu g++-riscv64-linux-gnu qemu-user 4 | 5 | def set_riscv64_platform(env): 6 | env.Replace(EMBEDDED = "RISCV64") 7 | env.Replace(CC = "riscv64-linux-gnu-gcc", 8 | CXX = "riscv64-linux-gnu-g++") 9 | env.Replace(TEST_RUNNER = "/usr/bin/qemu-riscv64") 10 | env.Append(LINKFLAGS = "-static") 11 | 12 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/splint/SConscript: -------------------------------------------------------------------------------- 1 | # Check the nanopb core using splint 2 | 3 | Import('env') 4 | 5 | p = env.WhereIs('splint') 6 | 7 | if p: 8 | env.Command('pb_decode.splint', '$NANOPB/pb_decode.c', 9 | 'splint -f splint/splint.rc $SOURCE 2> $TARGET') 10 | 11 | env.Command('pb_encode.splint', '$NANOPB/pb_encode.c', 12 | 'splint -f splint/splint.rc $SOURCE 2> $TARGET') 13 | 14 | env.Command('pb_common.splint', '$NANOPB/pb_common.c', 15 | 'splint -f splint/splint.rc $SOURCE 2> $TARGET') 16 | 17 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_205/SConscript: -------------------------------------------------------------------------------- 1 | # Check that pb_release() correctly handles corrupted size fields of 2 | # static arrays. 3 | 4 | Import('env', 'malloc_env') 5 | 6 | env.NanopbProto('size_corruption') 7 | 8 | p = malloc_env.Program(["size_corruption.c", 9 | "size_corruption.pb.c", 10 | "$COMMON/pb_decode_with_malloc.o", 11 | "$COMMON/pb_common_with_malloc.o", 12 | "$COMMON/malloc_wrappers.o"]) 13 | env.RunTest(p) 14 | 15 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_227/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for Issue 227:Using proto3 type fields can cause unaligned access 2 | # NOTE: This test will only detect problems when run with clang sanitizer (which 3 | # is done regularly by a jenkins run). 4 | 5 | Import('env') 6 | 7 | env.NanopbProto('unaligned_uint64') 8 | 9 | p = env.Program(["unaligned_uint64.c", 10 | "unaligned_uint64.pb.c", 11 | "$COMMON/pb_encode.o", 12 | "$COMMON/pb_common.o"]) 13 | env.RunTest(p) 14 | 15 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_631/submsg_callback.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import 'nanopb.proto'; 4 | 5 | message SubMsg1 { 6 | optional float number1 = 1 [default = 1]; 7 | } 8 | 9 | message SubMsg2 { 10 | repeated uint32 number2 = 1; 11 | } 12 | 13 | message SubMsgCB { 14 | option (nanopb_msgopt).submsg_callback = true; 15 | repeated SubMsg1 field1 = 1; 16 | oneof data { 17 | uint32 uint = 2; 18 | sint32 sint = 3 [default = 3]; 19 | SubMsg2 vuint = 4; 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /Firmware/nanopb/examples/using_union_messages/Makefile: -------------------------------------------------------------------------------- 1 | # Include the nanopb provided Makefile rules 2 | include ../../extra/nanopb.mk 3 | 4 | # Compiler flags to enable all warnings & debug info 5 | CFLAGS = -ansi -Wall -Werror -g -O0 6 | CFLAGS += -I$(NANOPB_DIR) 7 | 8 | all: encode decode 9 | ./encode 1 | ./decode 10 | ./encode 2 | ./decode 11 | ./encode 3 | ./decode 12 | 13 | .SUFFIXES: 14 | 15 | clean: 16 | rm -f encode unionproto.pb.h unionproto.pb.c 17 | 18 | %: %.c unionproto.pb.c 19 | $(CC) $(CFLAGS) -o $@ $^ $(NANOPB_CORE) 20 | 21 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_545/submsg_callback.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "nanopb.proto"; 4 | 5 | message SubMessage3 { 6 | required uint32 foo = 1; 7 | } 8 | 9 | message SubMessage2 { 10 | oneof oneof { 11 | SubMessage3 submsg = 1 [(nanopb).submsg_callback = true]; 12 | } 13 | } 14 | 15 | message SubMessage1 { 16 | repeated SubMessage2 msgs = 1 [(nanopb).max_count = 16]; 17 | } 18 | 19 | message MainMessage { 20 | required SubMessage1 msg = 1; 21 | required uint32 foo = 2; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /Firmware/nanopb/generator/nanopb_generator.py2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # This file is a wrapper around nanopb_generator.py in case you want to run 3 | # it with Python 2 instead of default Python 3. This only exists for backwards 4 | # compatibility, do not use for new projects. 5 | 6 | from nanopb_generator import * 7 | 8 | if __name__ == '__main__': 9 | # Check if we are running as a plugin under protoc 10 | if 'protoc-gen-' in sys.argv[0] or '--protoc-plugin' in sys.argv: 11 | main_plugin() 12 | else: 13 | main_cli() 14 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/fixed_count/SConscript: -------------------------------------------------------------------------------- 1 | # Test that fixed count option works. 2 | 3 | Import("malloc_env") 4 | 5 | malloc_env.NanopbProto("fixed_count") 6 | malloc_env.Object("fixed_count.pb.c") 7 | 8 | p = malloc_env.Program(["fixed_count_unittests.c", 9 | "fixed_count.pb.c", 10 | "$COMMON/pb_encode_with_malloc.o", 11 | "$COMMON/pb_decode_with_malloc.o", 12 | "$COMMON/pb_common_with_malloc.o", 13 | "$COMMON/malloc_wrappers.o"]) 14 | 15 | malloc_env.RunTest(p) 16 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/fuzztest/flakystream.h: -------------------------------------------------------------------------------- 1 | /* This module implements a custom input stream that can be set to give IO error 2 | * at specific point. */ 3 | 4 | #ifndef FLAKYSTREAM_H 5 | #define FLAKYSTREAM_H 6 | 7 | #include 8 | 9 | typedef struct { 10 | pb_istream_t stream; 11 | const uint8_t *buffer; 12 | size_t position; 13 | size_t msglen; 14 | size_t fail_after; 15 | } flakystream_t; 16 | 17 | void flakystream_init(flakystream_t *stream, const uint8_t *buffer, size_t msglen, size_t fail_after); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /Firmware/nanopb/examples/network_server/fileproto.proto: -------------------------------------------------------------------------------- 1 | // This defines protocol for a simple server that lists files. 2 | // 3 | // See also the nanopb-specific options in fileproto.options. 4 | 5 | syntax = "proto2"; 6 | 7 | message ListFilesRequest { 8 | optional string path = 1 [default = "/"]; 9 | } 10 | 11 | message FileInfo { 12 | required uint64 inode = 1; 13 | required string name = 2; 14 | } 15 | 16 | message ListFilesResponse { 17 | optional bool path_error = 1 [default = false]; 18 | repeated FileInfo file = 2; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/callbacks/callbacks.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message SubMessage { 4 | optional string stringvalue = 1; 5 | repeated int32 int32value = 2; 6 | repeated fixed32 fixed32value = 3; 7 | repeated fixed64 fixed64value = 4; 8 | } 9 | 10 | message TestMessage { 11 | optional string stringvalue = 1; 12 | repeated int32 int32value = 2; 13 | repeated fixed32 fixed32value = 3; 14 | repeated fixed64 fixed64value = 4; 15 | optional SubMessage submsg = 5; 16 | repeated string repeatedstring = 6; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /Firmware/nanopb/extra/bazel/python_deps.bzl: -------------------------------------------------------------------------------- 1 | load("@rules_python//python:pip.bzl", "pip_parse") 2 | 3 | def nanopb_python_deps(interpreter=None): 4 | # Required for python deps for generator plugin. 5 | # Used by: com_github_nanopb_nanopb. 6 | # Used in modules: generator. 7 | if "nanopb_pypi" not in native.existing_rules(): 8 | pip_parse( 9 | name = "nanopb_pypi", 10 | requirements_lock = "@com_github_nanopb_nanopb//:extra/requirements_lock.txt", 11 | python_interpreter_target = interpreter, 12 | ) 13 | -------------------------------------------------------------------------------- /Firmware/nanopb/extra/poetry/poetry_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | rm -rf build 6 | mkdir build 7 | mkdir -p dist 8 | 9 | (cd "$(git rev-parse --show-toplevel)"; git archive HEAD) > build/tmp.tar 10 | cd build 11 | ln -s ../dist . 12 | 13 | mkdir nanopb 14 | tar xf tmp.tar README.md generator 15 | mv generator nanopb/ 16 | touch nanopb/__init__.py nanopb/generator/__init__.py 17 | make -C nanopb/generator/proto 18 | cp ../pyproject.toml . 19 | sed -i -e 's/\(version =.*\)-dev.*/\1-dev'$(git rev-list HEAD --count)'"/' pyproject.toml 20 | poetry build 21 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/infinity_nan/floats.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message Floats { 4 | optional float float_pos_inf = 1 [default = inf]; 5 | optional float float_neg_inf = 2 [default = -inf]; 6 | optional float float_pos_nan = 3 [default = nan]; 7 | optional float float_neg_nan = 4 [default = -nan]; 8 | optional double double_pos_inf = 5 [default = inf]; 9 | optional double double_neg_inf = 6 [default = -inf]; 10 | optional double double_pos_nan = 7 [default = nan]; 11 | optional double double_neg_nan = 8 [default = -nan]; 12 | } 13 | -------------------------------------------------------------------------------- /Firmware/ParamLockPoolInternal.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import 'nanopb.proto'; 3 | 4 | 5 | message ParamLockPoolInternal 6 | { 7 | message ParamLock { 8 | uint32 index = 1; 9 | uint32 step = 2 [(nanopb).int_size = IS_8]; 10 | uint32 param = 3 [(nanopb).int_size = IS_8]; 11 | uint32 value = 4 [(nanopb).int_size = IS_8]; 12 | uint32 next = 5 [(nanopb).int_size = IS_16]; 13 | } 14 | repeated ParamLock locks = 1; 15 | uint32 freeLocks = 2; 16 | } -------------------------------------------------------------------------------- /Firmware/nanopb/tests/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | scons 3 | 4 | clean: 5 | scons -c 6 | 7 | coverage: 8 | rm -rf build coverage 9 | 10 | # LCOV does not like the newer gcov format 11 | scons CC=gcc-4.6 CXX=gcc-4.6 12 | 13 | # Collect the data 14 | mkdir build/coverage 15 | lcov --base-directory . --directory build/ --gcov-tool gcov-4.6 -c -o build/coverage/nanopb.info 16 | 17 | # Remove the test code from results 18 | lcov -r build/coverage/nanopb.info '*tests*' -o build/coverage/nanopb.info 19 | 20 | # Generate HTML 21 | genhtml -o build/coverage build/coverage/nanopb.info 22 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/enum_minmax/enumminmax.proto: -------------------------------------------------------------------------------- 1 | /* Test out-of-order enum values. 2 | */ 3 | 4 | syntax = "proto3"; 5 | 6 | enum Language { 7 | UNKNOWN = 0; 8 | ENGLISH_EN_GB = 12; 9 | ENGLISH_EN_US = 1; 10 | FRENCH_FR_FR = 2; 11 | ITALIAN_IT_IT = 3; 12 | GERMAN_DE_DE = 4; 13 | SPANISH_ES_AR = 13; 14 | SPANISH_ES_ES = 5; 15 | SPANISH_ES_MX = 14; 16 | SWEDISH_SV_SE = 6; 17 | DUTCH_NL_NL = 7; 18 | KOREAN_KO_KR = 8; 19 | JAPANESE_JA_JP = 9; 20 | CHINESE_SIMPLIFIED_ZH_CN = 10; 21 | CHINESE_TRADITIONAL_ZH_TW = 11; 22 | } 23 | -------------------------------------------------------------------------------- /Firmware/nanopb/examples/cmake_relpath/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | project(NANOPB_CMAKE_SIMPLE C) 3 | 4 | set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../extra) 5 | find_package(Nanopb REQUIRED) 6 | include_directories(${NANOPB_INCLUDE_DIRS}) 7 | 8 | nanopb_generate_cpp(PROTO_SRCS PROTO_HDRS RELPATH proto 9 | proto/simple.proto proto/sub/unlucky.proto) 10 | 11 | include_directories(${CMAKE_CURRENT_BINARY_DIR}) 12 | 13 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -g -O0") 14 | 15 | add_executable(simple simple.c ${PROTO_SRCS} ${PROTO_HDRS}) 16 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/common/person.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "nanopb.proto"; 4 | 5 | message Person { 6 | required string name = 1 [(nanopb).max_size = 40]; 7 | required int32 id = 2; 8 | optional string email = 3 [(nanopb).max_size = 40]; 9 | 10 | enum PhoneType { 11 | MOBILE = 0; 12 | HOME = 1; 13 | WORK = 2; 14 | } 15 | 16 | message PhoneNumber { 17 | required string number = 1 [(nanopb).max_size = 40]; 18 | optional PhoneType type = 2 [default = HOME]; 19 | } 20 | 21 | repeated PhoneNumber phone = 4 [(nanopb).max_count = 5]; 22 | } 23 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/anonymous_oneof/oneof.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import 'nanopb.proto'; 4 | 5 | message SubMessage 6 | { 7 | repeated int32 array = 1 [(nanopb).max_count = 8]; 8 | } 9 | 10 | /* Oneof in a message with other fields */ 11 | message AnonymousOneOfMessage 12 | { 13 | option (nanopb_msgopt).anonymous_oneof = true; 14 | required int32 prefix = 1; 15 | oneof values 16 | { 17 | int32 first = 5; 18 | string second = 6 [(nanopb).max_size = 8]; 19 | SubMessage third = 7; 20 | } 21 | required int32 suffix = 99; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/basic_buffer/SConscript: -------------------------------------------------------------------------------- 1 | # Build and run a basic round-trip test using memory buffer encoding. 2 | 3 | Import("env") 4 | 5 | enc = env.Program(["encode_buffer.c", "$COMMON/person.pb.c", "$COMMON/pb_encode.o", "$COMMON/pb_common.o"]) 6 | dec = env.Program(["decode_buffer.c", "$COMMON/person.pb.c", "$COMMON/pb_decode.o", "$COMMON/pb_common.o"]) 7 | 8 | env.RunTest(enc) 9 | env.RunTest([dec, "encode_buffer.output"]) 10 | env.Decode(["encode_buffer.output", "$COMMON/person.proto"], MESSAGE = "Person") 11 | env.Compare(["decode_buffer.output", "encode_buffer.decoded"]) 12 | 13 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/basic_stream/SConscript: -------------------------------------------------------------------------------- 1 | # Build and run a basic round-trip test using direct stream encoding. 2 | 3 | Import("env") 4 | 5 | enc = env.Program(["encode_stream.c", "$COMMON/person.pb.c", "$COMMON/pb_encode.o", "$COMMON/pb_common.o"]) 6 | dec = env.Program(["decode_stream.c", "$COMMON/person.pb.c", "$COMMON/pb_decode.o", "$COMMON/pb_common.o"]) 7 | 8 | env.RunTest(enc) 9 | env.RunTest([dec, "encode_stream.output"]) 10 | env.Decode(["encode_stream.output", "$COMMON/person.proto"], MESSAGE = "Person") 11 | env.Compare(["decode_stream.output", "encode_stream.decoded"]) 12 | 13 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/GHSA-gcx3-7m76-287p/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for security issue GHSA-gcx3-7m76-287p 2 | # "Out-of-memory condition on repeated field can result in invalid free()" 3 | 4 | Import("malloc_env") 5 | 6 | malloc_env.NanopbProto("test") 7 | 8 | test = malloc_env.Program(["test.c", "test.pb.c", 9 | "$COMMON/pb_decode_with_malloc.o", 10 | "$COMMON/pb_common_with_malloc.o", 11 | "$COMMON/malloc_wrappers.o"]) 12 | 13 | malloc_env.RunTest([test, 'test_input.pb']) 14 | -------------------------------------------------------------------------------- /Firmware/mclk_output.pio: -------------------------------------------------------------------------------- 1 | ; 2 | ; this appears to be totally unnecessary 3 | ; 4 | ; 5 | ; 6 | 7 | .program mclk_output 8 | loop: 9 | set pins, 1 ; Drive pin high 10 | set pins, 0 ; Drive pin low 11 | jmp loop 12 | 13 | 14 | % c-sdk { 15 | static inline void mclk_output_program_init(PIO pio, uint sm, uint offset, uint pin) { 16 | pio_gpio_init(pio, pin); 17 | pio_sm_set_consecutive_pindirs(pio, sm, pin, 1, true); 18 | pio_sm_config c = mclk_output_program_get_default_config(offset); 19 | sm_config_set_set_pins(&c, pin, 1); 20 | pio_sm_init(pio, sm, offset, &c); 21 | } 22 | %} 23 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_494/oneof_size.cc: -------------------------------------------------------------------------------- 1 | #include "oneof.pb.h" 2 | #include "unittests.h" 3 | 4 | extern "C" int main() 5 | { 6 | int status = 0; 7 | 8 | // Expected maximum encoded size: 9 | // 1 byte for MyMessage.foo tag 10 | // 1-5 bytes for MyMessage.foo submsg length 11 | // 1 byte for SubMessage3.foo tag 12 | // 5 bytes for SubMessage3.foo value 13 | // 1 byte for SubMessage3.bar tag 14 | // 5 bytes for SubMessage3.bar value 15 | printf("Size: %d\n", (int)MyMessage_size); 16 | TEST(MyMessage_size == 18); 17 | 18 | return status; 19 | } 20 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/docker_images/ubuntu2004/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:focal 2 | 3 | RUN apt -y update 4 | RUN apt -y upgrade 5 | RUN apt -y dist-upgrade 6 | RUN apt -y autoremove 7 | RUN apt -y install --fix-missing 8 | RUN apt -y install apt-utils 9 | 10 | RUN apt -y install git scons build-essential g++ 11 | RUN apt -y install protobuf-compiler python3.8 python3-protobuf 12 | RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1 && update-alternatives --set python /usr/bin/python3.8 13 | 14 | RUN git clone https://github.com/nanopb/nanopb.git 15 | RUN cd nanopb/tests && scons 16 | 17 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/multiple_files/multifile2.proto: -------------------------------------------------------------------------------- 1 | // Test if including generated header file for this file + implicit include of 2 | // multifile2.pb.h still compiles. Used with test_compiles.c. 3 | syntax = "proto2"; 4 | 5 | import "multifile1.proto"; 6 | 7 | message Callback2Message { 8 | required TestMessage tstmsg = 1; 9 | required SubMessage submsg = 2; 10 | } 11 | 12 | message OneofMessage { 13 | oneof msgs { 14 | StaticMessage tstmsg = 1; 15 | } 16 | } 17 | 18 | message Enums { 19 | required SignedEnum senum = 1; 20 | required UnsignedEnum uenum = 2; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /Firmware/nanopb/WORKSPACE: -------------------------------------------------------------------------------- 1 | workspace(name = "com_github_nanopb_nanopb") 2 | 3 | load("//extra/bazel:nanopb_deps.bzl", "nanopb_deps") 4 | 5 | nanopb_deps() 6 | 7 | load("@rules_python//python:repositories.bzl", "python_register_toolchains") 8 | 9 | python_register_toolchains( 10 | name = "python3_9", 11 | python_version = "3.9", 12 | ) 13 | 14 | load("//extra/bazel:python_deps.bzl", "nanopb_python_deps") 15 | 16 | load("@python3_9//:defs.bzl", "interpreter") 17 | 18 | nanopb_python_deps(interpreter) 19 | 20 | load("//extra/bazel:nanopb_workspace.bzl", "nanopb_workspace") 21 | 22 | nanopb_workspace() 23 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/callbacks/SConscript: -------------------------------------------------------------------------------- 1 | # Test the functionality of the callback fields. 2 | 3 | Import("env") 4 | 5 | env.NanopbProto("callbacks") 6 | enc = env.Program(["encode_callbacks.c", "callbacks.pb.c", "$COMMON/pb_encode.o", "$COMMON/pb_common.o"]) 7 | dec = env.Program(["decode_callbacks.c", "callbacks.pb.c", "$COMMON/pb_decode.o", "$COMMON/pb_common.o"]) 8 | 9 | env.RunTest(enc) 10 | env.RunTest([dec, "encode_callbacks.output"]) 11 | 12 | env.Decode(["encode_callbacks.output", "callbacks.proto"], MESSAGE = "TestMessage") 13 | env.Compare(["decode_callbacks.output", "encode_callbacks.decoded"]) 14 | 15 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/extensions/extensions.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import 'alltypes.proto'; 4 | 5 | extend AllTypes { 6 | optional int32 AllTypes_extensionfield1 = 255 [default = 5]; 7 | } 8 | 9 | message ExtensionMessage { 10 | extend AllTypes { 11 | optional ExtensionMessage AllTypes_extensionfield2 = 254; 12 | // required ExtensionMessage AllTypes_extensionfield3 = 253; // No longer allowed by protobuf 3 13 | repeated ExtensionMessage AllTypes_extensionfield4 = 252; 14 | } 15 | 16 | required string test1 = 1; 17 | required int32 test2 = 2; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/options/SConscript: -------------------------------------------------------------------------------- 1 | # Test that the generator options work as expected. 2 | 3 | Import("env") 4 | 5 | env.NanopbProto("options") 6 | env.Object('options.pb.c') 7 | env.Match('options_h.matched', ['options.pb.h', 'options_h.expected']) 8 | env.Match('options_c.matched', ['options.pb.c', 'options_c.expected']) 9 | 10 | env.NanopbProto("proto3_options") 11 | env.Object('proto3_options.pb.c') 12 | env.Match(['proto3_options.pb.h', 'proto3_options.expected']) 13 | 14 | p = env.Program(["options.c", "options.pb.c", "$COMMON/pb_decode.o", "$COMMON/pb_encode.o", "$COMMON/pb_common.o"]) 15 | env.RunTest(p) 16 | -------------------------------------------------------------------------------- /Firmware/SampleFile.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // bitmask for tracking free blocks 4 | uint32_t freeblocks_bitmask[32]; 5 | 6 | // holds information about the file for each sample 7 | struct SampleFile 8 | { 9 | // lets simplify for now, we might just be able to get away with an array (until this proves to be memory inefficient) 10 | // the issue is if we record an entire sample into a single spot, we will really need a way to point to the block offsets more cheaply in ram 11 | // or potentially use flash, but I don't want to think about the difficulties there. 12 | uint32_t sampleBlocks[32]; 13 | }; -------------------------------------------------------------------------------- /Firmware/multicore_support.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pico/multicore.h" 3 | #include "pico/util/queue.h" 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | typedef struct 9 | { 10 | bool screen_flip_ready; 11 | int renderInstrument; 12 | uint8_t *sync_buffer; 13 | int16_t *workBuffer; 14 | } queue_entry_t; 15 | 16 | typedef struct 17 | { 18 | bool screenFlipComplete; 19 | bool renderInstrumentComplete; 20 | } queue_entry_complete_t; 21 | 22 | extern queue_t signal_queue; 23 | extern queue_t complete_queue; 24 | extern queue_t renderCompleteQueue; 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /Firmware/MidiParamMapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "hardware/uart.h" 4 | #include "pico/stdlib.h" 5 | #include "voice_data.h" 6 | 7 | struct MidiParamMap 8 | { 9 | uint8_t voice; 10 | uint8_t param; 11 | uint8_t keyTarget; // for parameters that have per key values (i.e. sample loop points) 12 | }; 13 | 14 | class MidiParamMapper 15 | { 16 | public: 17 | MidiParamMapper(); 18 | void UpdateCC(VoiceData voiceData[], uint8_t cc, uint8_t newValue, uint8_t currentPattern); 19 | void SetCCTarget(uint8_t cc, uint8_t voice, uint8_t param, uint8_t keyTarget); 20 | private: 21 | MidiParamMap paramMap[128]; 22 | }; -------------------------------------------------------------------------------- /Firmware/VoiceDataInternal.pb.c: -------------------------------------------------------------------------------- 1 | /* Automatically generated nanopb constant definitions */ 2 | /* Generated by nanopb-0.4.8-dev */ 3 | 4 | #include "VoiceDataInternal.pb.h" 5 | #if PB_PROTO_HEADER_VERSION != 40 6 | #error Regenerate this file with the current version of nanopb generator. 7 | #endif 8 | 9 | PB_BIND(VoiceDataInternal, VoiceDataInternal, 2) 10 | 11 | 12 | PB_BIND(VoiceDataInternal_Pattern, VoiceDataInternal_Pattern, AUTO) 13 | 14 | 15 | PB_BIND(VoiceDataInternal_EnvelopeData, VoiceDataInternal_EnvelopeData, AUTO) 16 | 17 | 18 | PB_BIND(VoiceDataInternal_LockPointer, VoiceDataInternal_LockPointer, AUTO) 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_188/oneof.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message MessageOne 4 | { 5 | required uint32 one = 1; 6 | required uint32 two = 2; 7 | required uint32 three = 3; 8 | required int32 four = 4; 9 | } 10 | 11 | enum EnumTwo 12 | { 13 | SOME_ENUM_1 = 1; 14 | SOME_ENUM_2 = 5; 15 | SOME_ENUM_3 = 6; 16 | SOME_ENUM_4 = 9; 17 | SOME_ENUM_5 = 10; 18 | SOME_ENUM_6 = 12; 19 | SOME_ENUM_7 = 39; 20 | SOME_ENUM_8 = 401; 21 | } 22 | 23 | message OneofMessage 24 | { 25 | oneof payload { 26 | MessageOne message = 1; 27 | EnumTwo enum = 2; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Firmware/nanopb/examples/cmake_relpath/README.txt: -------------------------------------------------------------------------------- 1 | Nanopb example "simple" using CMake 2 | ======================= 3 | 4 | This example is the same as the simple nanopb example but built using CMake. 5 | 6 | Example usage 7 | ------------- 8 | 9 | On Linux, create a build directory and then call cmake: 10 | 11 | nanopb/examples/cmake_simple$ mkdir build 12 | nanopb/examples/cmake_simple$ cd build/ 13 | nanopb/examples/cmake_simple/build$ cmake .. 14 | nanopb/examples/cmake_simple/build$ make 15 | 16 | After that, you can run it with the command: ./simple 17 | 18 | On other platforms supported by CMake, refer to CMake instructions. 19 | -------------------------------------------------------------------------------- /Firmware/nanopb/examples/cmake_simple/README.txt: -------------------------------------------------------------------------------- 1 | Nanopb example "simple" using CMake 2 | ======================= 3 | 4 | This example is the same as the simple nanopb example but built using CMake. 5 | 6 | Example usage 7 | ------------- 8 | 9 | On Linux, create a build directory and then call cmake: 10 | 11 | nanopb/examples/cmake_simple$ mkdir build 12 | nanopb/examples/cmake_simple$ cd build/ 13 | nanopb/examples/cmake_simple/build$ cmake .. 14 | nanopb/examples/cmake_simple/build$ make 15 | 16 | After that, you can run it with the command: ./simple 17 | 18 | On other platforms supported by CMake, refer to CMake instructions. 19 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/enum_to_string/enum_to_string.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "unittests.h" 3 | #include "enum.pb.h" 4 | 5 | int main() 6 | { 7 | int status = 0; 8 | TEST(strcmp(MyEnum_name(MyEnum_VALUE1), "VALUE1") == 0); 9 | TEST(strcmp(MyEnum_name(MyEnum_VALUE2), "VALUE2") == 0); 10 | TEST(strcmp(MyEnum_name(MyEnum_VALUE15), "VALUE15") == 0); 11 | TEST(strcmp(MyShortNameEnum_name(MSNE_VALUE256), "MSNE_VALUE256") == 0); 12 | TEST(strcmp(MyShortNameEnum_name(9999), "unknown") == 0); 13 | 14 | if (status != 0) 15 | fprintf(stdout, "\n\nSome tests FAILED!\n"); 16 | 17 | return status; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/multiple_files/SConscript: -------------------------------------------------------------------------------- 1 | # Test that multiple .proto files don't cause name collisions. 2 | 3 | Import("env") 4 | 5 | incpath = env.Clone() 6 | incpath.Append(PROTOCPATH = '#multiple_files') 7 | incpath.Append(CPPPATH = '$BUILD/multiple_files') 8 | 9 | incpath.NanopbProto(["multifile1", "multifile1.options"]) 10 | incpath.NanopbProto("multifile2") 11 | incpath.NanopbProto("subdir/multifile2") 12 | test = incpath.Program(["test_multiple_files.c", "multifile1.pb.c", 13 | "multifile2.pb.c", "subdir/multifile2.pb.c", 14 | "$COMMON/pb_common.o"]) 15 | 16 | env.RunTest(test) 17 | 18 | -------------------------------------------------------------------------------- /Firmware/nanopb/generator/protoc-gen-nanopb-py2: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This file is used to invoke nanopb_generator.py2 as a plugin 4 | # to protoc on Linux and other *nix-style systems. 5 | # 6 | # The difference from protoc-gen-nanopb is that this executes with Python 2. 7 | # 8 | # Use it like this: 9 | # protoc --plugin=protoc-gen-nanopb=..../protoc-gen-nanopb-py2 --nanopb_out=dir foo.proto 10 | # 11 | # Note that if you use the binary package of nanopb, the protoc 12 | # path is already set up properly and there is no need to give 13 | # --plugin= on the command line. 14 | 15 | MYPATH=$(dirname "$0") 16 | exec "$MYPATH/nanopb_generator.py2" --protoc-plugin 17 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/typename_mangling/test_strip_package.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Tests if expected names are generated when M_STRIP_PACKAGE is used. 3 | */ 4 | 5 | #include 6 | #include "unittests.h" 7 | #include "strip_package.pb.h" 8 | 9 | int main() 10 | { 11 | TopLevelMessage msg = {0}; 12 | TopLevelMessage_NestedMessage_NestedLevel2_NestedLevel3 nmsg = msg.nested.nested.nested; 13 | 14 | msg.short_if_none = TopLevelMessage_ShortIfNone_IfNone_A; 15 | msg.short_if_strip_package = TopLevelMessage_IfPackage_A; 16 | msg.short_if_flatten = TopLevelMessage_ShortIfFlatten_IfFlatten_A; 17 | 18 | return nmsg.nothing; /* marks nmsg as used */ 19 | } 20 | -------------------------------------------------------------------------------- /Firmware/Serializer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "hardware/flash.h" 3 | #include "pico/multicore.h" 4 | #include 5 | #include 6 | #include "filesystem.h" 7 | 8 | class Serializer 9 | { 10 | public: 11 | void Init(uint16_t id); 12 | void AddData(uint8_t val); 13 | void Finish(); 14 | uint8_t GetNextValue(); 15 | void Erase(); 16 | ffs_file writeFile; 17 | private: 18 | void FlushToFlash(); 19 | uint32_t writePosition; 20 | uint32_t readPosition; 21 | uint32_t flashPosition; 22 | uint8_t data[256]; 23 | bool needsSectorErase; 24 | }; -------------------------------------------------------------------------------- /Firmware/nanopb/tests/multiple_files/subdir/multifile2.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package subdir; 4 | 5 | import "multifile1.proto"; 6 | 7 | message Callback2Message { 8 | required TestMessage tstmsg = 1; 9 | required SubMessage submsg = 2; 10 | } 11 | 12 | message SmallMessage { 13 | required bool dummy = 1; 14 | } 15 | 16 | message OneofMessage { 17 | oneof msgs { 18 | StaticMessage tstmsg = 1; 19 | SmallMessage msg2 = 2; 20 | } 21 | } 22 | 23 | message Enums { 24 | required SignedEnum senum = 1; 25 | required UnsignedEnum uenum = 2; 26 | } 27 | 28 | message SubdirMessage { 29 | required int32 foo = 1 [default = 15]; 30 | } 31 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_838/enum_to_string.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | #include "unittests.h" 3 | #include "enum.pb.h" 4 | 5 | extern "C" int main() 6 | { 7 | int status = 0; 8 | TEST(strcmp(MyEnum_name(MyEnum_VALUE1), "VALUE1") == 0); 9 | TEST(strcmp(MyEnum_name(MyEnum_VALUE2), "VALUE2") == 0); 10 | TEST(strcmp(MyEnum_name(MyEnum_VALUE15), "VALUE15") == 0); 11 | TEST(strcmp(MyShortNameEnum_name(MSNE_VALUE256), "MSNE_VALUE256") == 0); 12 | TEST(strcmp(MyShortNameEnum_name((MyShortNameEnum)9999), "unknown") == 0); 13 | 14 | if (status != 0) 15 | fprintf(stdout, "\n\nSome tests FAILED!\n"); 16 | 17 | return status; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_485/SConscript: -------------------------------------------------------------------------------- 1 | # Check that the int8_t and uint8_t types are not used in the nanopb core. 2 | 3 | Import("env") 4 | env.Match('pb_decode_c.matched', ["$NANOPB/pb_decode.c", 'uint8.expected']) 5 | env.Match('pb_decode_h.matched', ["$NANOPB/pb_decode.h", 'uint8.expected']) 6 | env.Match('pb_encode_c.matched', ["$NANOPB/pb_encode.c", 'uint8.expected']) 7 | env.Match('pb_encode_h.matched', ["$NANOPB/pb_encode.h", 'uint8.expected']) 8 | env.Match('pb_common_c.matched', ["$NANOPB/pb_common.c", 'uint8.expected']) 9 | env.Match('pb_common_h.matched', ["$NANOPB/pb_common.h", 'uint8.expected']) 10 | env.Match('pb_h.matched', ["$NANOPB/pb.h", 'uint8.expected']) 11 | 12 | -------------------------------------------------------------------------------- /Enclosure/frontplate/generation_notes.txt: -------------------------------------------------------------------------------- 1 | ### Frontplate generation notes 2 | 3 | sorry, non free software. Hopefully it keeps working for a while. I'll include SVGs of the frontplate so it can continue to be edited. 4 | 5 | export the mask and silkscreen groups to pngs that are 5119x7875 (aka 2000dpi) 6 | 7 | import into kicad using the image converter tool. Use the output size settings to 65mm / 100.1mm (set lock height width ratio). 8 | 9 | for both images, you will need to use the "negative" button to invert correctly. 10 | 11 | in the pcb editor, double click on the footprints, then update from library. You may need to disable layers so you can correctly double click on the soldermask footprint. -------------------------------------------------------------------------------- /Firmware/nanopb/tests/cyclic_messages/cyclic.proto: -------------------------------------------------------------------------------- 1 | // Test structures with cyclic references. 2 | // These can only be handled in pointer/callback mode, 3 | // see associated .options files. 4 | 5 | syntax = "proto2"; 6 | 7 | message TreeNode 8 | { 9 | optional int32 leaf = 1; 10 | optional TreeNode left = 2; 11 | optional TreeNode right = 3; 12 | } 13 | 14 | message Dictionary 15 | { 16 | repeated KeyValuePair dictItem = 1; 17 | } 18 | 19 | message KeyValuePair 20 | { 21 | required string key = 1; 22 | optional string stringValue = 2; 23 | optional int32 intValue = 3; 24 | optional Dictionary dictValue = 4; 25 | optional TreeNode treeValue = 5; 26 | } 27 | 28 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_395/test.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | message Error 4 | { 5 | int32 code = 1; 6 | string message = 2; 7 | } 8 | 9 | message SubSubAMessage 10 | { 11 | string somestring = 1; 12 | } 13 | 14 | message SubSubBMessage 15 | { 16 | string somestring = 1; 17 | } 18 | 19 | message SubMessage 20 | { 21 | SubSubAMessage subsubmessageA = 1; 22 | repeated SubSubBMessage subsubmessageB = 2; 23 | } 24 | 25 | message Reply 26 | { 27 | enum Result 28 | { 29 | ERROR = 0; 30 | OK = 1; 31 | SOME_A = 2; 32 | } 33 | 34 | Result result = 1; 35 | Error error = 2; 36 | SubMessage submessage = 3; 37 | } 38 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/typename_mangling/test_flatten.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Tests if expected names are generated when M_FLATTEN is used. 3 | */ 4 | 5 | #include 6 | #include "unittests.h" 7 | #include "flatten.pb.h" 8 | 9 | int main() 10 | { 11 | TopLevelMessage msg = {0}; 12 | NestedMessage nmsg = msg.nested; 13 | NestedLevel2 nmsg2 = nmsg.nested; 14 | NestedLevel3 nmsg3 = nmsg2.nested; 15 | nmsg3.nothing = 42; 16 | 17 | msg.short_if_none = ShortIfNone_IfNone_A; 18 | msg.short_if_strip_package = ShortIfStripPackage_IfPackage_A; 19 | msg.short_if_flatten = IfFlatten_A; 20 | 21 | return nmsg3.nothing; /* this sets `nmsg3` as used, to prevent warning */ 22 | } 23 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_644/int64.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | message MessageTest { 3 | optional int64 test1 = 1; 4 | optional int64 test2 = 2; 5 | optional int64 test3 = 3; 6 | optional int64 test4 = 4; 7 | optional int64 test5 = 5; 8 | optional int64 test6 = 6; 9 | optional int64 test7 = 7; 10 | optional int64 test8 = 8; 11 | optional int64 test9 = 9; 12 | optional int64 test10 = 10; 13 | optional int64 test11 = 11; 14 | optional int64 test12 = 12; 15 | optional int64 test13 = 13; 16 | optional int64 test14 = 14; 17 | optional int64 test15 = 15; 18 | optional int64 test16 = 16; 19 | optional int64 test17 = 17; 20 | } 21 | 22 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_795/test.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "nanopb.proto"; 4 | 5 | package test.package; 6 | 7 | message GenericResponse 8 | { 9 | bool success = 1; 10 | string detail = 2 [(nanopb).max_length = 127]; 11 | int32 int_code = 3; 12 | } 13 | 14 | message TrippleInt { 15 | int32 v1 = 1; 16 | int32 v2 = 2; 17 | int32 v3 = 3; 18 | } 19 | 20 | message TrippleDouble { 21 | double v1 = 1; 22 | double v2 = 2; 23 | double v3 = 3; 24 | } 25 | 26 | enum CircuitID { 27 | CIRCUIT_ID_DRIVE_MOTORS = 0; 28 | CIRCUIT_ID_GENERATOR = 1; 29 | CIRCUIT_ID_PAYLOAD = 2; 30 | CIRCUIT_ID_MID = 3; 31 | CIRCUIT_ID_SPARE = 4; 32 | } 33 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/map/SConscript: -------------------------------------------------------------------------------- 1 | # Example / test for handling 'map' type using the backwards compatibility 2 | # in protobuf specification: 3 | # https://developers.google.com/protocol-buffers/docs/proto3#maps 4 | 5 | Import('env') 6 | 7 | env.NanopbProto(['map', 'map.options']) 8 | 9 | enc = env.Program(['encode_map.c', 10 | 'map.pb.c', 11 | '$COMMON/pb_encode.o', 12 | '$COMMON/pb_common.o']) 13 | 14 | dec = env.Program(['decode_map.c', 15 | 'map.pb.c', 16 | '$COMMON/pb_decode.o', 17 | '$COMMON/pb_common.o']) 18 | 19 | env.RunTest("message.pb", enc) 20 | env.RunTest("message.txt", [dec, 'message.pb']) 21 | 22 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_172/SConscript: -------------------------------------------------------------------------------- 1 | # Verify that _size define is generated for messages that have 2 | # includes from another directory. 3 | 4 | Import('env') 5 | 6 | incpath = env.Clone() 7 | incpath.Append(PROTOCPATH="#regression/issue_172/submessage") 8 | incpath.Append(CPPPATH="$BUILD/regression/issue_172/submessage") 9 | incpath.Append(CPPPATH="$BUILD/regression/issue_172/") 10 | incpath.NanopbProto('test') 11 | incpath.NanopbProto(['submessage/submessage', 'submessage/submessage.options']) 12 | 13 | p = incpath.Program(["msg_size.c", 14 | "test.pb.c", 15 | "submessage/submessage.pb.c", 16 | '$COMMON/pb_common.o']) 17 | 18 | 19 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/typename_mangling/test_package_initials.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Tests if expected names are generated when M_STRIP_PACKAGE is used. 3 | */ 4 | 5 | #include 6 | #include "unittests.h" 7 | #include "package_initials.pb.h" 8 | 9 | int main() 10 | { 11 | cen_TopLevelMessage msg = {0}; 12 | cen_TopLevelMessage_NestedMessage_NestedLevel2_NestedLevel3 nmsg = msg.nested.nested.nested; 13 | 14 | msg.short_if_none = cen_TopLevelMessage_ShortIfNone_IfNone_A; 15 | msg.short_if_strip_package = cen_TopLevelMessage_ShortIfStripPackage_IfPackage_A; 16 | msg.short_if_flatten = cen_TopLevelMessage_ShortIfFlatten_IfFlatten_A; 17 | 18 | return nmsg.nothing; /* marks nmsg as used */ 19 | } 20 | -------------------------------------------------------------------------------- /Firmware/nanopb/.gitignore: -------------------------------------------------------------------------------- 1 | *.gcda 2 | *.gcno 3 | *.gcov 4 | *.o 5 | *.pb.c 6 | *.pb.h 7 | *.pb 8 | *.pyc 9 | *_pb2.py 10 | *~ 11 | *.tar.gz 12 | *.swp 13 | .sconsign.dblite 14 | config.log 15 | .sconf_temp 16 | tests/build 17 | julkaisu.txt 18 | dist 19 | docs/*.html 20 | docs/generator_flow.png 21 | examples/simple/simple 22 | examples/network_server/client 23 | examples/network_server/server 24 | examples/using_double_on_avr/decode_double 25 | examples/using_double_on_avr/encode_double 26 | examples/using_double_on_avr/test_conversions 27 | examples/using_union_messages/decode 28 | examples/using_union_messages/encode 29 | generator/nanopb_pb2.pyc 30 | !generator-bin/**/* 31 | bazel-* 32 | extra/poetry/build 33 | build/ 34 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/message_sizes/messages1.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | enum MessageStatus { 4 | FAIL = 0; 5 | OK = 1; 6 | }; 7 | 8 | message MessageInfo { 9 | required fixed32 msg_id = 1; 10 | optional fixed32 interface_id = 2; 11 | } 12 | 13 | message MessageResponseInfo { 14 | required fixed64 interface_id = 1; 15 | required fixed32 seq = 2; 16 | required fixed32 msg_id = 3; 17 | } 18 | 19 | message MessageHeader { 20 | required MessageInfo info = 1; 21 | optional MessageResponseInfo response_info = 2; 22 | optional MessageResponse response = 3; 23 | } 24 | 25 | message MessageResponse { 26 | required MessageStatus status = 1; 27 | required fixed32 seq = 2; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_522/uenum.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | enum ReadingType { 4 | UNKNOWN = 0; 5 | TEMP = 1; 6 | HUMIDITY = 2; 7 | PRESSURE = 3; 8 | CO2 = 4; 9 | LIGHT = 5; 10 | POWER = 6; 11 | } 12 | 13 | message Reading { 14 | ReadingType readingType = 1; 15 | float floatVal = 2; 16 | } 17 | 18 | message Lora { 19 | float rssi = 1; 20 | float frequency_error = 2; 21 | float snr = 3; 22 | } 23 | 24 | message Meta { 25 | int32 device_id = 1; 26 | string device_type = 2; 27 | float voltage = 3; 28 | Lora lora = 4; 29 | } 30 | 31 | message Packet { 32 | int32 packet_id = 1; 33 | Meta meta = 2; 34 | repeated Reading data = 3; 35 | } 36 | 37 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_547/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for issue #547: 2 | # Buffer overflow when encoding bytes with size set to 65535 3 | 4 | Import("env") 5 | 6 | env.NanopbProto("test.proto") 7 | 8 | # Define the compilation options 9 | opts = env.Clone() 10 | opts.Append(CPPDEFINES = {'PB_FIELD_32BIT': 1}) 11 | 12 | # Build new version of core 13 | strict = opts.Clone() 14 | strict.Append(CFLAGS = strict['CORECFLAGS']) 15 | strict.Object("pb_encode_fields32.o", "$NANOPB/pb_encode.c") 16 | strict.Object("pb_common_fields32.o", "$NANOPB/pb_common.c") 17 | 18 | # Build and run test 19 | test = opts.Program(["test.c", "test.pb.c", "pb_encode_fields32.o", "pb_common_fields32.o"]) 20 | 21 | env.RunTest(test) 22 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/site_scons/platforms/stm32/run_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BINARY=$1 4 | BASENAME=$(basename $1) 5 | shift 6 | ARGS=$* 7 | 8 | test X$OPENOCD_BOARD == X && export OPENOCD_BOARD=board/stm32f7discovery.cfg 9 | 10 | timeout 1200s openocd -f $OPENOCD_BOARD \ 11 | -c "reset_config srst_only srst_nogate connect_assert_srst" \ 12 | -c "init" -c "arm semihosting enable" \ 13 | -c "arm semihosting_cmdline $BASENAME $ARGS" \ 14 | -c "reset halt" \ 15 | -c "load_image $BINARY 0" \ 16 | -c "reset halt" -c "resume 0x20000040" 2>openocd.log 17 | 18 | RESULT=$? 19 | 20 | if [ "$RESULT" -ne "0" ] 21 | then 22 | cat openocd.log >&2 23 | echo >&2 24 | fi 25 | 26 | exit $RESULT 27 | 28 | 29 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_783/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for issues #783 and #820: 2 | # Could not find enum type when using mangle_names:M_STRIP_PACKAGE 3 | # when using multiple packages. Same when overriding package name 4 | # with "(nanopb_fileopt).package". 5 | 6 | Import('env') 7 | 8 | incpath = env.Clone() 9 | incpath.Append(CPPPATH="$BUILD/regression/issue_783") 10 | 11 | a = incpath.NanopbProto(['folder_A/file_A', 'folder_A/file_A.options']) 12 | b = incpath.NanopbProto(['folder_C/file_C']) 13 | c = incpath.NanopbProto(['folder_B/file_B']) 14 | 15 | incpath.Depends(c, [a, b]) 16 | 17 | incpath.Object('folder_A/file_A.pb.c') 18 | incpath.Object('folder_B/file_B.pb.c') 19 | incpath.Object('folder_C/file_C.pb.c') 20 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/namingstyle/naming_style.options: -------------------------------------------------------------------------------- 1 | * long_names:true 2 | * enum_to_string:true 3 | 4 | MainMessage.repeatedNumber max_count:4, fixed_count:true 5 | MainMessage.string_Values1 type:FT_POINTER 6 | MainMessage.stringValues2 max_length:40, max_count:5 7 | MainMessage.requiredString max_length:10 8 | MainMessage.repeatedFixed32 max_count:10 9 | MainMessage.requiredBytes1 max_size:10, fixed_length:true 10 | MainMessage.requiredBytes2 max_size:10 11 | MainMessage.repeatedBytes1 type:FT_POINTER 12 | MainMessage.repeatedBytes2 type:FT_POINTER, fixed_count:true, max_count:5 13 | MainMessage.repeatedInts type:FT_POINTER 14 | MainMessage.SUB_MESSAGE2 type:FT_CALLBACK 15 | MainMessage.oneOfName2 anonymous_oneof:true 16 | -------------------------------------------------------------------------------- /Firmware/nanopb/examples/network_server/fileproto.options: -------------------------------------------------------------------------------- 1 | # This file defines the nanopb-specific options for the messages defined 2 | # in fileproto.proto. 3 | # 4 | # If you come from high-level programming background, the hardcoded 5 | # maximum lengths may disgust you. However, if your microcontroller only 6 | # has a few kB of ram to begin with, setting reasonable limits for 7 | # filenames is ok. 8 | # 9 | # On the other hand, using the callback interface, it is not necessary 10 | # to set a limit on the number of files in the response. 11 | 12 | * include:"sys/types.h" 13 | * include:"dirent.h" 14 | ListFilesResponse.file type:FT_CALLBACK, callback_datatype:"DIR*" 15 | ListFilesRequest.path max_size:128 16 | FileInfo.name max_size:128 17 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/extensions/SConscript: -------------------------------------------------------------------------------- 1 | # Test the support for extension fields. 2 | 3 | Import("env") 4 | 5 | # We use the files from the alltypes test case 6 | incpath = env.Clone() 7 | incpath.Append(PROTOCPATH = '$BUILD/alltypes') 8 | incpath.Append(CPPPATH = '$BUILD/alltypes') 9 | 10 | incpath.NanopbProto(["extensions", "extensions.options"]) 11 | enc = incpath.Program(["encode_extensions.c", "extensions.pb.c", "$BUILD/alltypes/alltypes.pb$OBJSUFFIX", "$COMMON/pb_encode.o", "$COMMON/pb_common.o"]) 12 | dec = incpath.Program(["decode_extensions.c", "extensions.pb.c", "$BUILD/alltypes/alltypes.pb$OBJSUFFIX", "$COMMON/pb_decode.o", "$COMMON/pb_common.o"]) 13 | 14 | env.RunTest(enc) 15 | env.RunTest([dec, "encode_extensions.output"]) 16 | 17 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/special_characters/funny-proto+name has.characters.proto: -------------------------------------------------------------------------------- 1 | syntax="proto2"; 2 | 3 | // Unicode comment эмйÅÄÖ 4 | message WorkingMessage { 5 | required int32 b = 1; 6 | required int32 Z = 2; 7 | repeated int32 x = 3; 8 | } 9 | 10 | message FailingMessageBecauseMembersAreMacroParameter { 11 | required int32 a = 1; 12 | required int32 X = 2; 13 | } 14 | 15 | message TestMacroParametersAndUnderscores { 16 | required int32 a = 1; 17 | required int32 a_ = 2; 18 | required int32 X = 3; 19 | required int32 X_ = 4; 20 | required int32 X__ = 5; 21 | required int32 X___ = 6; 22 | required int32 X____ = 7; 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_617/test_oneof.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "oneof.pb.h" 4 | 5 | int main() 6 | { 7 | const uint8_t input_data[] = { 8 | 0x08, 0x01, 0x10, 0x0F, 0x18, 0xAC, 0x02, 0x20, 9 | 0xF1, 0x82, 0xA0, 0x85, 0x0C, 0x62, 0x00, 0x58, 10 | 0xF1, 0x82, 0xA0, 0x85, 0x0C 11 | }; 12 | 13 | int status = 0; 14 | TestMessage msg = TestMessage_init_zero; 15 | pb_istream_t stream = pb_istream_from_buffer(input_data, sizeof(input_data)); 16 | 17 | TEST(pb_decode(&stream, TestMessage_fields, &msg)); 18 | TEST(msg.which_payload == TestMessage_plb11_tag); 19 | TEST(msg.payload.plb11.name[0] == 0); 20 | 21 | return status; 22 | } 23 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/oneof/oneof.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import 'nanopb.proto'; 4 | 5 | message SubMessage 6 | { 7 | repeated int32 array = 1 [(nanopb).max_count = 8]; 8 | } 9 | 10 | /* Oneof in a message with other fields */ 11 | message OneOfMessage 12 | { 13 | required int32 prefix = 1; 14 | oneof values 15 | { 16 | int32 first = 5; 17 | string second = 6 [(nanopb).max_size = 8]; 18 | SubMessage third = 7; 19 | } 20 | required int32 suffix = 99; 21 | } 22 | 23 | /* Oneof in a message by itself */ 24 | message PlainOneOfMessage 25 | { 26 | oneof values 27 | { 28 | int32 first = 5; 29 | string second = 6 [(nanopb).max_size = 8]; 30 | SubMessage third = 7; 31 | } 32 | } -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_253/short_array.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "short_array.pb.h" 4 | 5 | int main() 6 | { 7 | int status = 0; 8 | 9 | COMMENT("Test message length calculation for short arrays"); 10 | { 11 | uint8_t buffer[TestMessage_size] = {0}; 12 | pb_ostream_t ostream = pb_ostream_from_buffer(buffer, TestMessage_size); 13 | TestMessage msg = TestMessage_init_zero; 14 | 15 | msg.rep_uint32_count = 1; 16 | msg.rep_uint32[0] = ((uint32_t)1 << 31); 17 | 18 | TEST(pb_encode(&ostream, TestMessage_fields, &msg)); 19 | TEST(ostream.bytes_written == TestMessage_size); 20 | } 21 | 22 | return status; 23 | } 24 | 25 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_259/SConscript: -------------------------------------------------------------------------------- 1 | # Check that callback fields inside malloc()ed messages 2 | # are correctly initialized. 3 | 4 | Import('env', 'malloc_env') 5 | 6 | env.NanopbProto('callback_pointer') 7 | 8 | p = malloc_env.Program(["callback_pointer.c", 9 | "callback_pointer.pb.c", 10 | "$COMMON/pb_decode_with_malloc.o", 11 | "$COMMON/pb_common_with_malloc.o", 12 | "$COMMON/malloc_wrappers.o"]) 13 | 14 | # Run test under valgrind if available 15 | kwargs = {} 16 | if env.get("VALGRIND"): 17 | kwargs['COMMAND'] = env['VALGRIND'] 18 | kwargs['ARGS'] = ["-q", "--error-exitcode=99", p[0].abspath] 19 | 20 | env.RunTest(p, **kwargs) 21 | 22 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/options/options_h.expected: -------------------------------------------------------------------------------- 1 | char filesize\[20\]; 2 | char msgsize\[30\]; 3 | char fieldsize\[40\]; 4 | char fieldlen\[41\]; 5 | pb_callback_t int32_callback; 6 | \sEnumValue1 = 1 7 | Message5_EnumValue1 8 | } pb_packed my_packed_struct; 9 | ! skipped_field 10 | ! SkippedMessage 11 | #define PB_MSG_103 Message3 12 | #define PB_MSG_104 Message4 13 | #define PB_MSG_105 Message5 14 | #define OPTIONS_MESSAGES \\ 15 | \s+PB_MSG\(103,[0-9]*,Message3\) \\ 16 | \s+PB_MSG\(104,-1,Message4\) \\ 17 | \s+PB_MSG\(105,[0-9]*,Message5\) \\ 18 | #define Message5_msgid 105 19 | ! has_proto3field 20 | Enum1 normal 21 | uint32_t overridden 22 | #define TypeOverrideMessage_init_default[ ]*\{_Enum1_MIN, 0\} 23 | #define TypeOverrideMessage_init_zero[ ]*\{_Enum1_MIN, 0\} 24 | 25 | -------------------------------------------------------------------------------- /Firmware/USBSerialDevice.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "tusb.h" 3 | 4 | class USBSerialDevice 5 | { 6 | public: 7 | void Init(); 8 | bool NeedsSongData(); 9 | bool PrepareReceiveData() { return prepareRecv; } 10 | void Update(); 11 | void SendData(const uint8_t* data, size_t count); 12 | bool GetData(uint8_t* data, size_t count); 13 | void SignalSongDataComplete() 14 | { 15 | needsSongData = false; 16 | } 17 | void SignalSongReceiveComplete() 18 | { 19 | prepareRecv = false; 20 | } 21 | void ResetLineBreak() { lineBreak = 0;} 22 | private: 23 | int lineBreak; 24 | char buf[64]; 25 | int bufOffset = 0; 26 | bool needsSongData = false; 27 | bool prepareRecv = false; 28 | char commandBuffer[64]; 29 | }; -------------------------------------------------------------------------------- /Firmware/nanopb/.github/workflows/bazel.yml: -------------------------------------------------------------------------------- 1 | name: Bazel 2 | 3 | on: 4 | workflow_dispatch: 5 | workflow_call: 6 | push: 7 | paths: 8 | - '**bazel**' 9 | pull_request: 10 | paths: 11 | - '**bazel**' 12 | 13 | jobs: 14 | build_embedded: 15 | runs-on: ${{ matrix.os }} 16 | strategy: 17 | matrix: 18 | os: [ubuntu-20.04, macos-10.15] 19 | 20 | steps: 21 | - uses: actions/checkout@v2 22 | 23 | - name: Mount bazel cache 24 | uses: actions/cache@v2 25 | with: 26 | path: "/home/runner/.cache/bazel" 27 | key: ${{ runner.os }}-bazel 28 | 29 | - name: Test 30 | run: | 31 | bazelisk test //... 32 | 33 | - name: Build 34 | run: | 35 | bazelisk build //... 36 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/splint/splint.rc: -------------------------------------------------------------------------------- 1 | +checks 2 | +partial 3 | +matchanyintegral 4 | +strictlib 5 | -nullassign 6 | -predboolint 7 | -predboolptr 8 | +ptrnegate 9 | -switchloopbreak 10 | +ignoresigns 11 | -infloopsuncon 12 | -type 13 | 14 | # splint's memory checks don't quite work without annotations 15 | -mustfreeonly 16 | -compmempass 17 | -nullret 18 | -observertrans 19 | -statictrans 20 | -compdestroy 21 | -nullpass 22 | -nullstate 23 | -compdef 24 | -usereleased 25 | -temptrans 26 | -dependenttrans 27 | -kepttrans 28 | -branchstate 29 | -immediatetrans 30 | -mustfreefresh 31 | -allimponly 32 | 33 | # These tests give false positives, compiler typically has 34 | # better warnings for these. 35 | -noret 36 | -noeffect 37 | -usedef 38 | 39 | # Splint doesn't support C11 40 | -DPB_C99_STATIC_ASSERT 41 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/float_double_conversion/SConscript: -------------------------------------------------------------------------------- 1 | Import("env") 2 | 3 | env.NanopbProto("doublemsg") 4 | 5 | # Define the compilation options 6 | opts = env.Clone() 7 | opts.Append(CPPDEFINES = {'PB_CONVERT_DOUBLE_FLOAT': 1}) 8 | 9 | if opts.get('EMBEDDED') == 'AVR': 10 | opts.Append(CFLAGS = "-Wno-overflow") 11 | 12 | # Build new version of core 13 | strict = opts.Clone() 14 | strict.Append(CFLAGS = strict['CORECFLAGS']) 15 | strict.Object("pb_decode_fldbl.o", "$NANOPB/pb_decode.c") 16 | strict.Object("pb_encode_fldbl.o", "$NANOPB/pb_encode.c") 17 | strict.Object("pb_common_fldbl.o", "$NANOPB/pb_common.c") 18 | 19 | # Build and run test 20 | test = opts.Program(["float_double_conversion.c", "doublemsg.pb.c", "pb_encode_fldbl.o", "pb_decode_fldbl.o", "pb_common_fldbl.o"]) 21 | env.RunTest(test) 22 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_547/test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "test.pb.h" 5 | 6 | int main() 7 | { 8 | pb_byte_t buf[512]; 9 | MyMessage msg = MyMessage_init_zero; 10 | pb_ostream_t stream = pb_ostream_from_buffer(buf, sizeof(buf)); 11 | 12 | msg.mybytes.size = 0xFFFFFFFF; 13 | 14 | if (pb_encode(&stream, MyMessage_fields, &msg)) 15 | { 16 | fprintf(stderr, "Failure: expected pb_encode() to fail.\n"); 17 | return 1; 18 | } 19 | else if (strcmp(PB_GET_ERROR(&stream), "bytes size exceeded") != 0) 20 | { 21 | fprintf(stderr, "Unexpected encoding error: %s\n", PB_GET_ERROR(&stream)); 22 | return 2; 23 | } 24 | else 25 | { 26 | return 0; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/multiple_files/multifile1.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message SubMessage { 4 | optional string stringvalue = 1; 5 | repeated int32 int32value = 2; 6 | repeated fixed32 fixed32value = 3; 7 | repeated fixed64 fixed64value = 4; 8 | } 9 | 10 | message TestMessage { 11 | optional string stringvalue = 1; 12 | repeated int32 int32value = 2; 13 | repeated fixed32 fixed32value = 3; 14 | repeated fixed64 fixed64value = 4; 15 | optional SubMessage submsg = 5; 16 | repeated string repeatedstring = 6; 17 | } 18 | 19 | message StaticMessage { 20 | repeated fixed32 repint32 = 1; 21 | } 22 | 23 | enum SignedEnum { 24 | SE_MIN = -128; 25 | SE_MAX = 127; 26 | } 27 | 28 | enum UnsignedEnum { 29 | UE_MIN = 0; 30 | UE_MAX = 255; 31 | } 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/oneof_callback/SConscript: -------------------------------------------------------------------------------- 1 | # Test decoder callback support inside oneofs. 2 | 3 | Import('env') 4 | 5 | env.NanopbProto('oneof') 6 | 7 | enc = env.Program(['encode_oneof.c', 8 | 'oneof.pb.c', 9 | '$COMMON/pb_encode.o', 10 | '$COMMON/pb_common.o']) 11 | 12 | dec = env.Program(['decode_oneof.c', 13 | 'oneof.pb.c', 14 | '$COMMON/pb_decode.o', 15 | '$COMMON/pb_common.o']) 16 | 17 | for i in range(1,7): 18 | # Encode message, then decode with protoc and test program and compare. 19 | e = env.RunTest("message%d.pb" % i, enc, ARGS = [str(i)]) 20 | d1 = env.Decode([e, "oneof.proto"], MESSAGE = "OneOfMessage") 21 | d2 = env.RunTest("message%d.txt" % i, [dec, e]) 22 | env.Compare([d1, d2]) 23 | -------------------------------------------------------------------------------- /Firmware/nanopb/examples/using_union_messages/unionproto.proto: -------------------------------------------------------------------------------- 1 | // This is an example of how to handle 'union' style messages 2 | // with nanopb, without allocating memory for all the message types. 3 | // 4 | // There is no official type in Protocol Buffers for describing unions, 5 | // but they are commonly implemented by filling out exactly one of 6 | // several optional fields. 7 | 8 | syntax = "proto2"; 9 | 10 | message MsgType1 11 | { 12 | required int32 value = 1; 13 | } 14 | 15 | message MsgType2 16 | { 17 | required bool value = 1; 18 | } 19 | 20 | message MsgType3 21 | { 22 | required int32 value1 = 1; 23 | required int32 value2 = 2; 24 | } 25 | 26 | message UnionMessage 27 | { 28 | optional MsgType1 msg1 = 1; 29 | optional MsgType2 msg2 = 2; 30 | optional MsgType3 msg3 = 3; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/anonymous_oneof/SConscript: -------------------------------------------------------------------------------- 1 | # Test anonymous_oneof generator option 2 | 3 | Import('env') 4 | 5 | # Anonymous oneofs are supported by clang and gcc 6 | if 'clang' in env['CC'] or 'gcc' in env['CC']: 7 | env2 = env.Clone() 8 | if '-pedantic' in env2['CFLAGS']: 9 | env2['CFLAGS'].remove('-pedantic') 10 | env2.NanopbProto('oneof') 11 | 12 | dec = env2.Program(['decode_oneof.c', 13 | 'oneof.pb.c', 14 | '$COMMON/pb_decode.o', 15 | '$COMMON/pb_common.o']) 16 | 17 | env2.RunTest("message1.txt", [dec, '$BUILD/oneof/message1.pb'], ARGS = ['1']) 18 | env2.RunTest("message2.txt", [dec, '$BUILD/oneof/message2.pb'], ARGS = ['2']) 19 | env2.RunTest("message3.txt", [dec, '$BUILD/oneof/message3.pb'], ARGS = ['3']) 20 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/common/unittests.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef UNITTESTS_SHORT_MSGS 4 | /* Short debug messages for platforms with limited memory */ 5 | #define COMMENT(x) printf("\n----" x "----\n"); 6 | #define TEST(x) \ 7 | if (!(x)) { \ 8 | fprintf(stderr, "FAIL: Line %d\n", __LINE__); \ 9 | status = 1; \ 10 | } else { \ 11 | printf("OK: Line %d\n", __LINE__); \ 12 | } 13 | 14 | #else 15 | 16 | /* Elaborate debug messages for normal development */ 17 | #define COMMENT(x) printf("\n----" x "----\n"); 18 | #define TEST(x) \ 19 | if (!(x)) { \ 20 | fprintf(stderr, "\033[31;1mFAILED:\033[22;39m %s:%d %s\n", __FILE__, __LINE__, #x); \ 21 | status = 1; \ 22 | } else { \ 23 | printf("\033[32;1mOK:\033[22;39m %s\n", #x); \ 24 | } 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/msgid/SConscript: -------------------------------------------------------------------------------- 1 | # Test the 'msgid' feature for identifying encoded messages 2 | 3 | Import('env') 4 | 5 | env.NanopbProto('msgid_example') 6 | 7 | enc = env.Program(['encode_msgid.c', 8 | 'msgid_example.pb.c', 9 | '$COMMON/pb_encode.o', 10 | '$COMMON/pb_common.o']) 11 | 12 | dec = env.Program(['decode_msgid.c', 13 | 'msgid_example.pb.c', 14 | '$COMMON/pb_decode.o', 15 | '$COMMON/pb_common.o']) 16 | 17 | env.RunTest("message1.pb", enc, ARGS = ['1']) 18 | env.RunTest("message1.txt", [dec, 'message1.pb']) 19 | env.RunTest("message2.pb", enc, ARGS = ['2']) 20 | env.RunTest("message2.txt", [dec, 'message2.pb']) 21 | env.RunTest("message3.pb", enc, ARGS = ['3']) 22 | env.RunTest("message3.txt", [dec, 'message3.pb']) 23 | -------------------------------------------------------------------------------- /Firmware/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Pico Debug", 6 | "type":"cortex-debug", 7 | "cwd": "${workspaceRoot}", 8 | "executable": "${command:cmake.launchTargetPath}", 9 | "request": "launch", 10 | "servertype": "external", 11 | // Connect to an already running OpenOCD instance 12 | "gdbTarget": "localhost:3333", 13 | "svdFile": "${env:PICO_SDK_PATH}/src/rp2040/hardware_regs/rp2040.svd", 14 | "runToMain": true, 15 | // Work around for stopping at main on restart 16 | //"postRestartCommands": [ 17 | // "break main", 18 | // "continue" 19 | //] 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /Firmware/nanopb/tests/oneof/SConscript: -------------------------------------------------------------------------------- 1 | # Test the 'oneof' feature for generating C unions. 2 | 3 | Import('env') 4 | 5 | env.NanopbProto('oneof') 6 | 7 | enc = env.Program(['encode_oneof.c', 8 | 'oneof.pb.c', 9 | '$COMMON/pb_encode.o', 10 | '$COMMON/pb_common.o']) 11 | 12 | dec = env.Program(['decode_oneof.c', 13 | 'oneof.pb.c', 14 | '$COMMON/pb_decode.o', 15 | '$COMMON/pb_common.o']) 16 | 17 | env.RunTest("message1.pb", enc, ARGS = ['1']) 18 | env.RunTest("message1.txt", [dec, 'message1.pb'], ARGS = ['1']) 19 | env.RunTest("message2.pb", enc, ARGS = ['2']) 20 | env.RunTest("message2.txt", [dec, 'message2.pb'], ARGS = ['2']) 21 | env.RunTest("message3.pb", enc, ARGS = ['3']) 22 | env.RunTest("message3.txt", [dec, 'message3.pb'], ARGS = ['3']) 23 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/options/options.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "options.pb.h" 4 | #include "unittests.h" 5 | 6 | int main() 7 | { 8 | int status = 0; 9 | 10 | { 11 | HasFieldMessage msg1 = HasFieldMessage_init_default; 12 | HasFieldMessage msg2 = HasFieldMessage_init_zero; 13 | 14 | COMMENT("Test default_has option"); 15 | 16 | /* Default initializer should obey has_default setting */ 17 | TEST(msg1.has_present == true); 18 | TEST(msg1.has_missing == false); 19 | TEST(msg1.has_normal == false); 20 | 21 | /* Zero initializer should always have false */ 22 | TEST(msg2.has_present == false); 23 | TEST(msg2.has_missing == false); 24 | TEST(msg2.has_normal == false); 25 | } 26 | 27 | return status; 28 | } 29 | -------------------------------------------------------------------------------- /Firmware/nanopb/examples/simple/Makefile: -------------------------------------------------------------------------------- 1 | # Include the nanopb provided Makefile rules 2 | include ../../extra/nanopb.mk 3 | 4 | # Compiler flags to enable all warnings & debug info 5 | CFLAGS = -Wall -Werror -g -O0 6 | CFLAGS += "-I$(NANOPB_DIR)" 7 | 8 | # C source code files that are required 9 | CSRC = simple.c # The main program 10 | CSRC += simple.pb.c # The compiled protocol definition 11 | CSRC += $(NANOPB_DIR)/pb_encode.c # The nanopb encoder 12 | CSRC += $(NANOPB_DIR)/pb_decode.c # The nanopb decoder 13 | CSRC += $(NANOPB_DIR)/pb_common.c # The nanopb common parts 14 | 15 | # Build rule for the main program 16 | simple: $(CSRC) 17 | $(CC) $(CFLAGS) -osimple $(CSRC) 18 | 19 | # Build rule for the protocol 20 | simple.pb.c: simple.proto 21 | $(PROTOC) $(PROTOC_OPTS) --nanopb_out=. simple.proto 22 | 23 | -------------------------------------------------------------------------------- /Enclosure/frontplate/frontplate.pro: -------------------------------------------------------------------------------- 1 | update=22/05/2015 07:44:53 2 | version=1 3 | last_client=kicad 4 | [general] 5 | version=1 6 | RootSch= 7 | BoardNm= 8 | [pcbnew] 9 | version=1 10 | LastNetListRead= 11 | UseCmpFile=1 12 | PadDrill=0.600000000000 13 | PadDrillOvalY=0.600000000000 14 | PadSizeH=1.500000000000 15 | PadSizeV=1.500000000000 16 | PcbTextSizeV=1.500000000000 17 | PcbTextSizeH=1.500000000000 18 | PcbTextThickness=0.300000000000 19 | ModuleTextSizeV=1.000000000000 20 | ModuleTextSizeH=1.000000000000 21 | ModuleTextSizeThickness=0.150000000000 22 | SolderMaskClearance=0.000000000000 23 | SolderMaskMinWidth=0.000000000000 24 | DrawSegmentWidth=0.200000000000 25 | BoardOutlineThickness=0.100000000000 26 | ModuleOutlineThickness=0.150000000000 27 | [cvpcb] 28 | version=1 29 | NetIExt=net 30 | [eeschema] 31 | version=1 32 | LibDir= 33 | [eeschema/libraries] 34 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_494/SConscript: -------------------------------------------------------------------------------- 1 | # Regression test for #494: 2 | # Using sizeof on anonymous union not allowed in C++, in message_size oneof sizing fallback 3 | 4 | Import('env') 5 | import os, sys 6 | 7 | # The build rules here are a bit tricky to make the normal dependency 8 | # resolution intentionally fail. This causes the generator to use the fallback 9 | # define which had the problem with C++. 10 | env.Command("oneof.pb", "oneof.proto", "$PROTOC $PROTOCFLAGS -I$BUILDDIR/regression/issue_494 -o$TARGETS $SOURCES") 11 | env.Command(["oneof.pb.c", "oneof.pb.h"], "oneof.pb", env['NANOPB_GENERATOR'] + " -D$BUILDDIR/regression/issue_494 $SOURCES") 12 | env.NanopbProto("submessage.proto") 13 | env.Depends("oneof.pb", "submessage.proto") 14 | 15 | test = env.Program(["oneof_size.cc"]) 16 | env.Depends(test, "oneof.pb.h") 17 | env.RunTest(test) 18 | -------------------------------------------------------------------------------- /Firmware/MidiParamMapper.cc: -------------------------------------------------------------------------------- 1 | #include "MidiParamMapper.h" 2 | 3 | MidiParamMapper::MidiParamMapper() 4 | { 5 | for(int i=0;i<128;i++) 6 | { 7 | paramMap[i].voice = 0xff; 8 | } 9 | } 10 | 11 | void MidiParamMapper::SetCCTarget(uint8_t cc, uint8_t voice, uint8_t param, uint8_t keyTarget) 12 | { 13 | assert(cc < 128); 14 | assert(voice < 16); 15 | paramMap[cc].voice = voice; 16 | paramMap[cc].param = param; 17 | paramMap[cc].keyTarget = keyTarget; 18 | } 19 | 20 | void MidiParamMapper::UpdateCC(VoiceData voiceData[], uint8_t cc, uint8_t newValue, uint8_t currentPattern) 21 | { 22 | assert(cc < 128); 23 | if(paramMap[cc].voice < 16) 24 | { 25 | uint8_t& current_a = voiceData[paramMap[cc].voice].GetParam(paramMap[cc].param, paramMap[cc].keyTarget, currentPattern); 26 | current_a = newValue; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Firmware/nanopb/tools/set_version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Run this from the top directory of nanopb tree. 4 | # e.g. user@localhost:~/nanopb$ tools/set_version.sh nanopb-0.1.9-dev 5 | # It sets the version number in pb.h and generator/nanopb_generator.py. 6 | 7 | sed -i -e 's/nanopb_version\s*=\s*"[^"]*"/nanopb_version = "'$1'"/' generator/nanopb_generator.py 8 | sed -i -e 's/#define\s*NANOPB_VERSION\s*.*/#define NANOPB_VERSION "'$1'"/' pb.h 9 | sed -i -e 's/set(\s*nanopb_VERSION_STRING\s*[^)]*)/set(nanopb_VERSION_STRING '$1')/' CMakeLists.txt 10 | 11 | VERSION_ONLY=$(echo $1 | sed 's/nanopb-//') 12 | if [[ $1 != *dev ]] 13 | then sed -i -e 's/"version":\s*"[^"]*"/"version": "'$VERSION_ONLY'"/' library.json 14 | fi 15 | 16 | sed -i -e 's/version =.*/version = "'$VERSION_ONLY'"/' conanfile.py 17 | sed -i -e 's/^version =.*/version = "'$VERSION_ONLY'"/' extra/poetry/pyproject.toml 18 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/any_type/SConscript: -------------------------------------------------------------------------------- 1 | # Test usage of Any type 2 | 3 | Import("env") 4 | 5 | incpath = env.Clone() 6 | incpath.Append(PROTOCPATH = '#any_type') 7 | incpath.Append(CPPPATH = '$BUILD/any_type') 8 | 9 | incpath.NanopbProto("anytest") 10 | incpath.NanopbProto(["google/protobuf/any", "google/protobuf/any.options"]) 11 | incpath.NanopbProto("google/protobuf/duration") 12 | 13 | enc = incpath.Program(["encode_any.c", "anytest.pb.c", "google/protobuf/any.pb.c", 14 | "google/protobuf/duration.pb.c", 15 | "$COMMON/pb_encode.o", "$COMMON/pb_common.o"]) 16 | 17 | dec = incpath.Program(["decode_any.c", "anytest.pb.c", "google/protobuf/any.pb.c", 18 | "google/protobuf/duration.pb.c", 19 | "$COMMON/pb_decode.o", "$COMMON/pb_common.o"]) 20 | 21 | env.RunTest(enc) 22 | env.RunTest([dec, "encode_any.output"]) 23 | 24 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/regression/issue_247/padding.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "padding.pb.h" 5 | 6 | int main() 7 | { 8 | int status = 0; 9 | 10 | TestMessage msg; 11 | 12 | /* Set padding bytes to garbage */ 13 | memset(&msg, 0xAA, sizeof(msg)); 14 | 15 | /* Set all meaningful fields to 0 */ 16 | msg.submsg.boolfield = false; 17 | msg.submsg.intfield = 0; 18 | 19 | /* Test encoding */ 20 | { 21 | pb_byte_t buf[128] = {0}; 22 | pb_ostream_t stream = pb_ostream_from_buffer(buf, sizeof(buf)); 23 | TEST(pb_encode(&stream, TestMessage_fields, &msg)); 24 | 25 | /* Because all fields have zero values, proto3 encoder 26 | * shouldn't write out anything. */ 27 | TEST(stream.bytes_written == 0); 28 | } 29 | 30 | return status; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /Firmware/nanopb/tests/proto3_optional/SConscript: -------------------------------------------------------------------------------- 1 | # Test proto3 "optional" field types. 2 | # This is supported in protoc 3.12 and newer. 3 | 4 | Import('env') 5 | import re 6 | 7 | version = None 8 | if 'PROTOC_VERSION' in env: 9 | match = re.search('([0-9]+).([0-9]+).([0-9]+)', env['PROTOC_VERSION']) 10 | version = (int(match.group(1)), int(match.group(2)), int(match.group(3))) 11 | 12 | # Oneof is supported by protoc >= 3.12.0 13 | if env.GetOption('clean') or (version and (version[0] > 3 or (version[0] == 3 and version[1] >= 12))): 14 | 15 | env2 = env.Clone() 16 | env2.Append(PROTOCFLAGS = "--experimental_allow_proto3_optional") 17 | 18 | env2.NanopbProto("optional.proto") 19 | opt = env2.Program(["optional.c", "optional.pb.c", 20 | "$COMMON/pb_decode.o", "$COMMON/pb_encode.o", 21 | "$COMMON/pb_common.o"]) 22 | env2.RunTest(opt) 23 | 24 | 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # For PCBs designed using KiCad: http://www.kicad-pcb.org/ 2 | # Format documentation: http://kicad-pcb.org/help/file-formats/ 3 | 4 | # Temporary files 5 | *.000 6 | *.bak 7 | *.bck 8 | *.kicad_pcb-bak 9 | *.sch-bak 10 | *~ 11 | _autosave-* 12 | *.tmp 13 | *-save.pro 14 | *-save.kicad_pcb 15 | fp-info-cache 16 | 17 | # Netlist files (exported from Eeschema) 18 | *.net 19 | 20 | # Autorouter files (exported from Pcbnew) 21 | *.dsn 22 | *.ses 23 | 24 | # Exported BOM files 25 | *.xml 26 | *.csv 27 | 28 | Firmware/build 29 | Firmware/openocd_picoprobe 30 | Hardware/gerber 31 | Hardware/tdm_* 32 | Enclosure/backplate_gerbers 33 | Enclosure/frontplate_gerbers 34 | Enclosure/temp 35 | 36 | *.pdb 37 | Enclosure/frontplate/frontplate-backups 38 | Enclosure/frontplate_gerbers.zip 39 | Hardware/kicad_project/tdm_v6-backups 40 | Hardware/gerber.zip 41 | Hardware/audcalc/audcalc-backups 42 | -------------------------------------------------------------------------------- /Firmware/nanopb/docs/Makefile: -------------------------------------------------------------------------------- 1 | INPUTS = index.md concepts.md reference.md security.md migration.md whats_new.md 2 | 3 | all: $(INPUTS:.md=.html) 4 | 5 | tmp_menu.html: $(INPUTS) 6 | echo '
' > $@ 7 | (echo '

Documentation index

'; \ 8 | for file in $^; do echo -n '1. ['; sed -n '1 s!^# Nanopb: !! p' $$file; \ 9 | echo -n "]("; echo $$file | sed 's/.md/.html)/' ; done;) | \ 10 | pandoc -f markdown -t html5 >> $@ 11 | echo '
' >> $@ 12 | 13 | %.html: %.md tmp_menu.html 14 | sed '1 s!#!%!' $< | \ 15 | pandoc -s -f markdown -t html5 -c lsr.css --toc --toc-depth=4 \ 16 | --variable 'header-includes=' \ 17 | --indented-code-classes=c \ 18 | -o $@ 19 | sed -i '/