├── .buildpackrc ├── .bundleignore ├── .circleci └── config.yml ├── .clang-format ├── .gitignore ├── .gitmodules ├── .workbench └── manifest.json ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Doxyfile ├── ISSUE_TEMPLATE.md ├── LICENSE ├── PULL_REQUEST_TEMPLATE.md ├── README.md ├── STYLE_GUIDE.md ├── bootloader ├── .gitignore ├── README.md ├── build.mk ├── import.mk ├── license.txt ├── makefile ├── prebootloader │ ├── makefile │ └── src │ │ └── rtl872x │ │ ├── mbr │ │ ├── bootloader_update.c │ │ ├── bootloader_update.h │ │ ├── build.mk │ │ ├── cxx_constructors.cpp │ │ ├── import.mk │ │ ├── include.mk │ │ ├── linker.ld │ │ ├── main.cpp │ │ ├── makefile │ │ ├── module_info.c │ │ ├── part1_import.c │ │ ├── part1_preinit_import.c │ │ ├── rtl_header.cpp │ │ ├── rtl_it.c │ │ ├── rtl_it.h │ │ ├── sources.mk │ │ └── tlm.mk │ │ ├── part1 │ │ ├── build.mk │ │ ├── cxx_constructors.cpp │ │ ├── import.mk │ │ ├── include.mk │ │ ├── ipc.c │ │ ├── linker.ld │ │ ├── makefile │ │ ├── module_info.c │ │ ├── part1_export.c │ │ ├── rtl_support.c │ │ ├── rtl_support.h │ │ ├── rtos_hook.cpp │ │ ├── sleep_handler.cpp │ │ ├── sleep_handler.h │ │ ├── sources.mk │ │ ├── tlm.mk │ │ ├── update_handler.c │ │ ├── update_handler.h │ │ ├── wififw_handler.cpp │ │ └── wififw_handler.h │ │ └── shared │ │ ├── bootloader_part1_export.ld │ │ ├── crc32_nolookup.c │ │ ├── include.mk │ │ ├── part1_dynalib.h │ │ └── part1_preinit_dynalib.h └── src │ ├── argon │ ├── include.mk │ └── sources.mk │ ├── b5som │ ├── include.mk │ └── sources.mk │ ├── boron │ ├── include.mk │ └── sources.mk │ ├── electron2 │ ├── include.mk │ └── sources.mk │ ├── main.c │ ├── module_info.c │ ├── msom │ ├── include.mk │ └── sources.mk │ ├── nRF52840 │ ├── bootloader_dct.c │ ├── bootloader_dct.h │ ├── concurrent_hal.c │ ├── core_hal.c │ ├── deviceid_hal.cpp │ ├── dfu_usb.c │ ├── feature_flags.cpp │ ├── feature_flags.h │ ├── hal_irq_flag.c │ ├── include.mk │ ├── inflate_impl.cpp │ ├── linker.ld │ ├── newlib.cpp │ ├── nrf_it.c │ ├── nrf_it.h │ ├── sources.mk │ ├── startup.c │ ├── usbd_device.cpp │ ├── usbd_device.h │ ├── usbd_dfu.cpp │ ├── usbd_dfu.h │ ├── usbd_dfu_mal.cpp │ └── usbd_dfu_mal.h │ ├── rtl872x │ ├── bkpreg_hal.c │ ├── bootloader_dct.c │ ├── bootloader_dct.h │ ├── core_hal.c │ ├── deviceid_hal.cpp │ ├── dfu_usb.c │ ├── feature_flags.cpp │ ├── feature_flags.h │ ├── hal_irq_flag.c │ ├── include.mk │ ├── inflate_impl.cpp │ ├── linker.ld │ ├── newlib.cpp │ ├── nonsecure.cpp │ ├── nonsecure.h │ ├── osdep_service.cpp │ ├── rtl_header.cpp │ ├── rtl_it.c │ ├── rtl_it.h │ ├── rtl_stubs.c │ ├── sources.mk │ ├── spark_wiring_interrupts.h │ ├── startup.c │ ├── stubs.cpp │ ├── usb_hal.cpp │ ├── usbd_dfu.cpp │ ├── usbd_dfu.h │ ├── usbd_dfu_mal.cpp │ └── usbd_dfu_mal.h │ ├── sources.mk │ ├── tracker │ ├── include.mk │ └── sources.mk │ ├── trackerm │ ├── include.mk │ └── sources.mk │ └── tron │ ├── include.mk │ └── sources.mk ├── build ├── arm-tlm.mk ├── arm-tools.mk ├── arm │ ├── linker │ │ ├── linker_arm_exception.ld │ │ ├── linker_build_id.ld │ │ ├── linker_freertos_task_symbols.ld │ │ ├── linker_module_end.ld │ │ ├── linker_module_info.ld │ │ ├── linker_module_info_ext.ld │ │ ├── linker_module_start.ld │ │ ├── linker_module_start_ext.ld │ │ ├── linker_newhalcpu.ld │ │ ├── linker_static_ram_end.ld │ │ ├── linker_static_ram_start.ld │ │ ├── nrf52840 │ │ │ ├── linker_backup_ram_system.ld │ │ │ ├── linker_backup_ram_user.ld │ │ │ ├── linker_nrf52840_sdk_libs.ld │ │ │ ├── linker_nrf52840_sdk_ram.ld │ │ │ ├── memory_backup_ram.ld │ │ │ ├── platform_flash.ld │ │ │ └── platform_ram.ld │ │ └── rtl872x │ │ │ ├── linker_backup_ram_system.ld │ │ │ ├── linker_backup_ram_user.ld │ │ │ ├── linker_rtl872x_rom_m23.ld │ │ │ ├── linker_rtl872x_rom_ns.ld │ │ │ ├── linker_rtl872x_rom_s.ld │ │ │ ├── memory_backup_ram.ld │ │ │ ├── platform_flash.ld │ │ │ ├── platform_ram.ld │ │ │ ├── platform_ram_m23.ld │ │ │ └── platform_ram_shared.ld │ └── startup │ │ ├── spark_init.S │ │ ├── startup_newhalcpu.S │ │ ├── startup_nrf52840.S │ │ ├── startup_rtl872x.S │ │ └── startup_rtl872x_m23.S ├── bin │ └── win32 │ │ └── sha256sum.exe ├── build.md ├── checks.mk ├── common-tools.mk ├── create_module.py ├── gcc-tools.mk ├── lang-std.mk ├── macros.mk ├── make_release.sh ├── module-defaults.mk ├── module.mk ├── os.mk ├── platform-id.mk ├── recurse.mk ├── release-publish.sh ├── release-tests.sh ├── release.sh ├── serial_switcher.py ├── test │ ├── assert.bash │ ├── boron.bats │ ├── build.bash │ ├── build.bats │ ├── files │ │ ├── applibs spaces │ │ │ ├── app1 │ │ │ │ └── app.cpp │ │ │ ├── lib1 │ │ │ │ ├── lib1.cpp │ │ │ │ └── lib1.h │ │ │ └── lib2 │ │ │ │ ├── lib2.cpp │ │ │ │ └── lib2.h │ │ ├── applibs │ │ │ ├── app │ │ │ │ └── app.cpp │ │ │ ├── lib1 │ │ │ │ ├── lib.cpp │ │ │ │ ├── lib1.h │ │ │ │ └── lib1internal │ │ │ │ │ └── lib1.h │ │ │ ├── lib2 │ │ │ │ ├── lib.cpp │ │ │ │ └── lib2.h │ │ │ └── readme.txt │ │ ├── applibs_v2 │ │ │ ├── app │ │ │ │ └── app.cpp │ │ │ ├── lib1 │ │ │ │ └── src │ │ │ │ │ ├── lib.cpp │ │ │ │ │ └── lib1.h │ │ │ └── lib2 │ │ │ │ ├── examples │ │ │ │ └── example1.cpp │ │ │ │ └── src │ │ │ │ ├── lib.cpp │ │ │ │ └── lib2.h │ │ └── applibs_v2_vendored │ │ │ ├── app │ │ │ ├── lib │ │ │ │ ├── lib1 │ │ │ │ │ └── src │ │ │ │ │ │ ├── lib.cpp │ │ │ │ │ │ └── lib1.h │ │ │ │ └── lib2 │ │ │ │ │ ├── examples │ │ │ │ │ └── example1.cpp │ │ │ │ │ └── src │ │ │ │ │ ├── lib.cpp │ │ │ │ │ └── lib2.h │ │ │ └── src │ │ │ │ └── app.cpp │ │ │ └── app_explicit │ │ │ └── src │ │ │ └── app.cpp │ ├── libs.bats │ ├── readme.md │ └── runall.bash ├── top-level-module.mk ├── verbose.mk └── version.mk ├── ci ├── build_boost.sh ├── cf_generate_message.sh ├── cf_update.sh ├── ci_release.sh ├── combine_binaries.sh ├── enumerate_build_matrix.sh ├── functions.sh ├── install_arm_gcc.sh ├── install_boost.sh ├── install_gcc.sh ├── install_gcovr.sh ├── run_tests.sh ├── test-build-tasks.ps1 ├── test-build-tasks.sh ├── test_setup.sh └── unit_tests.sh ├── communication-dynalib ├── import.mk ├── makefile └── src │ ├── build.mk │ └── communication_dynalib.c ├── communication ├── .gitignore ├── README.md ├── dtls.md ├── import.mk ├── inc │ ├── buffer_message_channel.h │ ├── coap.h │ ├── coap_api.h │ ├── coap_defs.h │ ├── coap_util.h │ ├── communication_dynalib.h │ ├── device_keys.h │ ├── dsakeygen.h │ ├── dtls_message_channel.h │ ├── dtls_session_persist.h │ ├── eckeygen.h │ ├── events.h │ ├── file_transfer.h │ ├── message_channel.h │ ├── messages.h │ ├── protocol.h │ ├── protocol_defs.h │ ├── protocol_selector.h │ ├── spark_descriptor.h │ ├── spark_protocol_functions.h │ ├── tls_callbacks.h │ └── v2 │ │ ├── coap_channel.h │ │ └── coap_tag.h ├── license.txt ├── makefile ├── src │ ├── build.mk │ ├── chunked_transfer.cpp │ ├── chunked_transfer.h │ ├── coap.cpp │ ├── coap_channel.cpp │ ├── coap_channel.h │ ├── coap_defs.cpp │ ├── coap_message_decoder.cpp │ ├── coap_message_decoder.h │ ├── coap_message_encoder.cpp │ ├── coap_message_encoder.h │ ├── coap_util.cpp │ ├── communication_diagnostic.cpp │ ├── communication_diagnostic.h │ ├── communication_dynalib.cpp │ ├── description.cpp │ ├── description.h │ ├── dsakeygen.cpp │ ├── dtls_message_channel.cpp │ ├── dtls_protocol.cpp │ ├── dtls_protocol.h │ ├── eckeygen.cpp │ ├── firmware_update.cpp │ ├── firmware_update.h │ ├── functions.h │ ├── handshake.cpp │ ├── handshake.h │ ├── include.mk │ ├── lightssl_message_channel.cpp │ ├── lightssl_message_channel.h │ ├── lightssl_protocol.cpp │ ├── lightssl_protocol.h │ ├── messages.cpp │ ├── ping.h │ ├── protocol.cpp │ ├── protocol_defs.cpp │ ├── protocol_util.cpp │ ├── protocol_util.h │ ├── publisher.cpp │ ├── publisher.h │ ├── spark_protocol_functions.cpp │ ├── subscriptions.cpp │ ├── subscriptions.h │ ├── timesyncmanager.h │ ├── v2 │ │ ├── coap_api.cpp │ │ ├── coap_channel.cpp │ │ ├── coap_options.cpp │ │ ├── coap_options.h │ │ ├── coap_payload.cpp │ │ ├── coap_payload.h │ │ └── coap_tag.cpp │ ├── variables.cpp │ └── variables.h ├── tests.mk └── tests │ ├── ConstructorFixture.cpp │ ├── ConstructorFixture.h │ ├── Main.cpp │ ├── TestAES.cpp │ ├── TestCoAP.cpp │ ├── TestDescriptor.cpp │ ├── TestEvents.cpp │ ├── TestHandshake.cpp │ ├── TestQueue.cpp │ ├── TestSparkProtocol.cpp │ ├── TestStateMachine.cpp │ ├── TestUserFunctions.cpp │ └── UnitTest++ │ ├── Makefile │ └── src │ ├── AssertException.cpp │ ├── AssertException.h │ ├── CheckMacros.h │ ├── Checks.cpp │ ├── Checks.h │ ├── Config.h │ ├── CurrentTest.cpp │ ├── CurrentTest.h │ ├── DeferredTestReporter.cpp │ ├── DeferredTestReporter.h │ ├── DeferredTestResult.cpp │ ├── DeferredTestResult.h │ ├── ExecuteTest.h │ ├── MemoryOutStream.cpp │ ├── MemoryOutStream.h │ ├── Posix │ ├── SignalTranslator.cpp │ ├── SignalTranslator.h │ ├── TimeHelpers.cpp │ └── TimeHelpers.h │ ├── ReportAssert.cpp │ ├── ReportAssert.h │ ├── Test.cpp │ ├── Test.h │ ├── TestDetails.cpp │ ├── TestDetails.h │ ├── TestList.cpp │ ├── TestList.h │ ├── TestMacros.h │ ├── TestReporter.cpp │ ├── TestReporter.h │ ├── TestReporterStdout.cpp │ ├── TestReporterStdout.h │ ├── TestResults.cpp │ ├── TestResults.h │ ├── TestRunner.cpp │ ├── TestRunner.h │ ├── TestSuite.h │ ├── TimeConstraint.cpp │ ├── TimeConstraint.h │ ├── TimeHelpers.h │ ├── UnitTest++.h │ ├── Win32 │ ├── TimeHelpers.cpp │ └── TimeHelpers.h │ ├── XmlTestReporter.cpp │ └── XmlTestReporter.h ├── crypto-dynalib ├── import.mk ├── makefile └── src │ ├── build.mk │ └── crypto_dynalib.c ├── crypto ├── import.mk ├── inc │ ├── crypto_dynalib.h │ ├── include.mk │ ├── mbedtls_compat.h │ ├── mbedtls_config.h │ ├── mbedtls_config_default.h │ └── mbedtls_util.h ├── makefile └── src │ ├── build.mk │ └── mbedtls_util.cpp ├── docs ├── artifacts.md ├── build.md ├── debugging.md ├── dependencies.md ├── doxygen │ ├── index.html │ └── mainpage.md ├── gettingstarted.md └── linkerscripts.md ├── dynalib ├── import.mk ├── inc │ ├── dynalib.h │ ├── include.mk │ ├── module_info.h │ └── module_info.inc ├── makefile └── src │ ├── build.mk │ └── readme.md ├── gsm0710muxer ├── build.mk ├── import.mk ├── include.mk └── makefile ├── hal-dynalib ├── import.mk ├── makefile ├── readme.md └── src │ ├── build.mk │ ├── hal_backup_ram.c │ ├── hal_ble.c │ ├── hal_bootloader.c │ ├── hal_can.c │ ├── hal_cellular.c │ ├── hal_concurrent.c │ ├── hal_core.c │ ├── hal_dct.c │ ├── hal_dynalib.c │ ├── hal_gpio.c │ ├── hal_i2c.c │ ├── hal_ifapi.c │ ├── hal_inet.c │ ├── hal_mesh_deprecated.c │ ├── hal_netdb.c │ ├── hal_nfc.c │ ├── hal_peripherals.c │ ├── hal_resolvapi.c │ ├── hal_rgbled.c │ ├── hal_socket.c │ ├── hal_spi.c │ ├── hal_storage.c │ ├── hal_syscall_posix.c │ ├── hal_usart.c │ ├── hal_usb.c │ ├── hal_watchdog.c │ └── hal_wlan.c ├── hal ├── build.mk ├── import.mk ├── inc │ ├── adc_hal.h │ ├── backup_ram_hal.h │ ├── ble_hal.h │ ├── ble_hal_defines.h │ ├── bootloader.h │ ├── bootloader_hal.h │ ├── button_hal.h │ ├── can_hal.h │ ├── cellular_hal.h │ ├── cellular_hal_cellular_global_identity.h │ ├── cellular_hal_constants.h │ ├── cellular_hal_utilities.h │ ├── concurrent_hal.h │ ├── core_hal.h │ ├── core_subsys_hal.h │ ├── dac_hal.h │ ├── delay_hal.h │ ├── device_code.h │ ├── deviceid_hal.h │ ├── dfu_hal.h │ ├── eeprom_hal.h │ ├── exflash_hal.h │ ├── exrtc_hal.h │ ├── flash_hal.h │ ├── gpio_hal.h │ ├── hal_dynalib.h │ ├── hal_dynalib_backup_ram.h │ ├── hal_dynalib_ble.h │ ├── hal_dynalib_bootloader.h │ ├── hal_dynalib_can.h │ ├── hal_dynalib_cellular.h │ ├── hal_dynalib_concurrent.h │ ├── hal_dynalib_core.h │ ├── hal_dynalib_dct.h │ ├── hal_dynalib_gpio.h │ ├── hal_dynalib_i2c.h │ ├── hal_dynalib_ifapi.h │ ├── hal_dynalib_inet_posix.h │ ├── hal_dynalib_mesh_deprecated.h │ ├── hal_dynalib_netdb_posix.h │ ├── hal_dynalib_nfc.h │ ├── hal_dynalib_ota.h │ ├── hal_dynalib_peripherals.h │ ├── hal_dynalib_posix_syscall.h │ ├── hal_dynalib_resolvapi.h │ ├── hal_dynalib_rgbled.h │ ├── hal_dynalib_socket.h │ ├── hal_dynalib_socket_compat.h │ ├── hal_dynalib_socket_posix.h │ ├── hal_dynalib_spi.h │ ├── hal_dynalib_storage.h │ ├── hal_dynalib_usart.h │ ├── hal_dynalib_usb.h │ ├── hal_dynalib_watchdog.h │ ├── hal_dynalib_wlan.h │ ├── hal_dynalib_wlan_compat.h │ ├── hal_irq_flag.h │ ├── hal_platform.h │ ├── i2c_hal.h │ ├── include.mk │ ├── inet_hal.h │ ├── inet_hal_compat.h │ ├── inet_hal_posix.h │ ├── interrupts_hal.h │ ├── memory_hal.h │ ├── mesh_hal_deprecated.h │ ├── net_hal.h │ ├── netdb_hal.h │ ├── nfc_hal.h │ ├── ota_flash_hal.h │ ├── pinmap_hal.h │ ├── platform_radio_stack.h │ ├── power_hal.h │ ├── product_store_hal.h │ ├── pwm_hal.h │ ├── radio_hal.h │ ├── rgbled_hal.h │ ├── rng_hal.h │ ├── rtc_hal.h │ ├── servo_hal.h │ ├── sleep_hal.h │ ├── socket_hal.h │ ├── socket_hal_compat.h │ ├── socket_hal_posix.h │ ├── spi_hal.h │ ├── storage_hal.h │ ├── syshealth_hal.h │ ├── timer_hal.h │ ├── tone_hal.h │ ├── usart_hal.h │ ├── usart_hal_private.h │ ├── usb_config_hal.h │ ├── usb_hal.h │ ├── user_hal.h │ ├── watchdog_base.h │ ├── watchdog_hal.h │ └── wlan_hal.h ├── makefile ├── network │ ├── api │ │ ├── ifapi.h │ │ ├── ifapi_driver_specific.h │ │ └── resolvapi.h │ ├── lwip │ │ ├── basenetif.cpp │ │ ├── basenetif.h │ │ ├── cellular │ │ │ ├── pppncpnetif.cpp │ │ │ └── pppncpnetif.h │ │ ├── dnsproxy.cpp │ │ ├── dnsproxy.h │ │ ├── esp32 │ │ │ ├── esp32_ncp_util.cpp │ │ │ ├── esp32ncpnetif.cpp │ │ │ └── esp32ncpnetif.h │ │ ├── ifapi.cpp │ │ ├── ifapi_impl.h │ │ ├── inet_hal.cpp │ │ ├── inet_hal_posix_impl.h │ │ ├── ipaddr_util.h │ │ ├── ipsockaddr.h │ │ ├── lwip_util.cpp │ │ ├── lwip_util.h │ │ ├── lwiphooks.c │ │ ├── lwiplock.h │ │ ├── memp_hook.cpp │ │ ├── memp_hook.h │ │ ├── nat.cpp │ │ ├── nat.h │ │ ├── netdb_hal.cpp │ │ ├── netdb_hal_impl.h │ │ ├── posix │ │ │ ├── arpa │ │ │ │ └── inet.h │ │ │ ├── netdb.h │ │ │ ├── netinet │ │ │ │ └── in.h │ │ │ ├── poll.h │ │ │ └── sys │ │ │ │ └── socket.h │ │ ├── ppp_client.cpp │ │ ├── ppp_client.h │ │ ├── ppp_configuration_option.h │ │ ├── ppp_ipcp.cpp │ │ ├── ppp_ipcp.h │ │ ├── ppp_ipcp_options.cpp │ │ ├── ppp_ipcp_options.h │ │ ├── ppp_ncp.cpp │ │ ├── ppp_ncp.h │ │ ├── pppservernetif.cpp │ │ ├── pppservernetif.h │ │ ├── realtek │ │ │ ├── rtlncpnetif.cpp │ │ │ └── rtlncpnetif.h │ │ ├── resolvapi.cpp │ │ ├── resolvapi_impl.h │ │ ├── socket_hal.cpp │ │ ├── socket_hal_posix_impl.h │ │ └── wiznet │ │ │ ├── wiznetif.cpp │ │ │ ├── wiznetif.h │ │ │ ├── wiznetif_config.cpp │ │ │ └── wiznetif_config.h │ ├── ncp │ │ ├── at_parser │ │ │ ├── at_command.cpp │ │ │ ├── at_command.h │ │ │ ├── at_parser.cpp │ │ │ ├── at_parser.h │ │ │ ├── at_parser_impl.cpp │ │ │ ├── at_parser_impl.h │ │ │ ├── at_response.cpp │ │ │ ├── at_response.h │ │ │ ├── at_server.cpp │ │ │ └── at_server.h │ │ ├── cellular │ │ │ ├── cellular_hal.cpp │ │ │ ├── cellular_ncp_client.h │ │ │ ├── cellular_network_manager.cpp │ │ │ ├── cellular_network_manager.h │ │ │ ├── ncp.h │ │ │ ├── network_config_db.cpp │ │ │ └── network_config_db.h │ │ ├── ncp_client.h │ │ └── wifi │ │ │ ├── ncp.h │ │ │ ├── platform_ncp_update.cpp │ │ │ ├── softap_http.h │ │ │ ├── wifi_ncp_client.h │ │ │ ├── wifi_network_manager.cpp │ │ │ ├── wifi_network_manager.h │ │ │ └── wlan_hal.cpp │ ├── ncp_client │ │ ├── esp32 │ │ │ ├── esp32_ncp_client.cpp │ │ │ └── esp32_ncp_client.h │ │ ├── quectel │ │ │ ├── quectel_ncp_client.cpp │ │ │ └── quectel_ncp_client.h │ │ ├── realtek │ │ │ ├── rtl_ncp_client.cpp │ │ │ └── rtl_ncp_client.h │ │ └── sara │ │ │ ├── sara_ncp_client.cpp │ │ │ └── sara_ncp_client.h │ └── util │ │ ├── simple_ntp_client.cpp │ │ ├── simple_ntp_client.h │ │ └── simple_ntp_client_detail.h ├── shared │ ├── cellular_enums_hal.h │ ├── cellular_ncp_dev_mapping.h │ ├── cellular_reg_status.h │ ├── cellular_sig_perc_mapping.cpp │ ├── cellular_sig_perc_mapping.h │ ├── cxx_abi.cpp │ ├── cxx_abi.h │ ├── demux.cpp │ ├── demux.h │ ├── filesystem.cpp │ ├── filesystem.h │ ├── flash_common.cpp │ ├── flash_common.h │ ├── flash_device_hal.h │ ├── hal_event.h │ ├── include.mk │ ├── inflate.cpp │ ├── inflate.h │ ├── inflate_impl.cpp │ ├── inflate_impl.h │ ├── mcp23s17.cpp │ ├── mcp23s17.h │ ├── module_info_hal.h │ ├── newlib_impure.cpp │ ├── newlib_impure.h │ ├── parse_server_address.h │ ├── platform_ncp.cpp │ ├── platform_ncp.h │ ├── platforms.h │ ├── power_hal.cpp │ ├── program_regs.h │ ├── spi_lock.h │ ├── static_event_group.h │ ├── static_recursive_cs.h │ ├── system_tick_hal.h │ ├── time_compat.cpp │ └── time_compat.h └── src │ ├── argon │ ├── app_usbd_string_config.h │ ├── bootloader_platform_12.c │ ├── bootloader_platform_22.c │ ├── hal_platform_config.h │ ├── include.mk │ ├── network │ │ └── network.cpp │ ├── ota_flash_hal.cpp │ ├── pinmap_defines.h │ ├── pinmap_hal.c │ ├── platform_ncp_argon.cpp │ ├── sources.mk │ ├── tlm.mk │ ├── user_platform_12.c │ └── user_platform_22.c │ ├── b5som │ ├── app_usbd_string_config.h │ ├── bootloader_platform_25.c │ ├── hal_platform_config.h │ ├── include.mk │ ├── network │ │ └── network.cpp │ ├── ota_flash_hal.cpp │ ├── pinmap_defines.h │ ├── pinmap_hal.c │ ├── platform_ncp_quectel.cpp │ ├── sources.mk │ ├── tlm.mk │ └── user_platform_25.c │ ├── boron │ ├── app_usbd_string_config.h │ ├── bootloader_platform_13.c │ ├── bootloader_platform_23.c │ ├── hal_platform_config.h │ ├── include.mk │ ├── network │ │ └── network.cpp │ ├── ota_flash_hal.cpp │ ├── pinmap_defines.h │ ├── pinmap_hal.c │ ├── platform_ncp_boron.cpp │ ├── sources.mk │ ├── tlm.mk │ ├── user_platform_13.c │ └── user_platform_23.c │ ├── electron2 │ ├── app_usbd_string_config.h │ ├── hal_platform_config.h │ ├── include.mk │ ├── network │ │ └── network.cpp │ ├── ota_flash_hal.cpp │ ├── pinmap_defines.h │ ├── pinmap_hal.c │ ├── platform_ncp_electron2.cpp │ ├── sources.mk │ └── tlm.mk │ ├── gcc │ ├── boost_asio.cpp │ ├── boost_asio_impl_src_wrap.h │ ├── boost_asio_wrap.h │ ├── boost_json.h │ ├── boost_posix_time_wrap.h │ ├── boost_program_options_wrap.h │ ├── boost_signals2_wrap.h │ ├── boost_thread_wrap.h │ ├── bootloader.h │ ├── button_hal_impl.h │ ├── concurrent_hal.cpp │ ├── concurrent_hal_impl.h │ ├── core_hal.cpp │ ├── core_msg.h │ ├── core_subsys_hal.c │ ├── dct_hal.h │ ├── delay_hal.cpp │ ├── device_config.cpp │ ├── device_config.h │ ├── device_globals.h │ ├── deviceid_hal.cpp │ ├── deviceid_hal_impl.h │ ├── eeprom_file.h │ ├── eeprom_hal.cpp │ ├── exflash_hal.cpp │ ├── filesystem_util.cpp │ ├── filesystem_util.h │ ├── gpio_hal.cpp │ ├── hal_platform_config.h │ ├── include.mk │ ├── inet_hal.cpp │ ├── interrupts_hal.cpp │ ├── interrupts_irq.h │ ├── littlefs │ │ ├── filesystem_impl.h │ │ ├── lfs_config.h │ │ └── lfs_utils.cpp │ ├── mbedtls │ │ └── mbedtls_config_platform.h │ ├── miniz_config.h │ ├── ota_flash_hal.cpp │ ├── ota_flash_hal_impl.h │ ├── ota_module.h │ ├── pinger.cpp │ ├── pinmap_impl.h │ ├── platform_headers.h │ ├── readme.md │ ├── rgbled_hal.cpp │ ├── rgbled_hal_impl.h │ ├── rng_hal.cpp │ ├── rtc_hal.cpp │ ├── sleep_hal.cpp │ ├── socket_hal.cpp │ ├── sources.mk │ ├── sparse_buffer.h │ ├── static_recursive_mutex.h │ ├── timer_hal.cpp │ ├── tlm.mk │ ├── usart_hal.cpp │ ├── usb_hal.cpp │ ├── watchdog_hal.cpp │ └── wlan_hal.cpp │ ├── msom │ ├── hal_platform_config.h │ ├── include.mk │ ├── network │ │ └── network.cpp │ ├── ota_flash_hal.cpp │ ├── pinmap_defines.cpp │ ├── pinmap_defines.h │ ├── platform_ncp_quectel.cpp │ ├── sources.mk │ └── tlm.mk │ ├── nRF52840 │ ├── adc_hal.cpp │ ├── ble_hal.cpp │ ├── ble_hal_impl.h │ ├── bootloader.cpp │ ├── bootloader_hal.c │ ├── button_hal.c │ ├── button_hal_impl.h │ ├── can_hal.cpp │ ├── check_nrf.h │ ├── concurrent_hal.cpp │ ├── concurrent_hal_impl.h │ ├── core_hal.c │ ├── core_subsys_hal.cpp │ ├── cxx_constructors.cpp │ ├── dac_hal.cpp │ ├── dct_hal.cpp │ ├── dct_hal.h │ ├── dct_hal_lock.cpp │ ├── delay_hal.cpp │ ├── device_code.cpp │ ├── deviceid_hal.cpp │ ├── deviceid_hal_impl.h │ ├── eeprom_hal.cpp │ ├── eeprom_hal_impl.h │ ├── event_group_stream.h │ ├── exflash_hal.cpp │ ├── exflash_hal_lock.cpp │ ├── exflash_hal_params.cpp │ ├── exflash_hal_params.h │ ├── exrtc_hal.cpp │ ├── flash_hal.c │ ├── freertos │ │ └── FreeRTOSConfig.h │ ├── gpio_hal.cpp │ ├── gsm0710muxer │ │ ├── channel_stream.h │ │ └── platform.h │ ├── hal_dynalib_export.cpp │ ├── hal_event.cpp │ ├── hal_irq_flag.c │ ├── hal_platform_nrf52840_config.h │ ├── i2c_hal.cpp │ ├── image_bootloader.sh │ ├── include.mk │ ├── inet_hal_compat.cpp │ ├── interrupts_hal.cpp │ ├── interrupts_irq.h │ ├── linker.ld │ ├── littlefs │ │ ├── filesystem_impl.h │ │ ├── lfs_config.h │ │ └── lfs_utils.cpp │ ├── lwip │ │ ├── arch │ │ │ ├── cc.h │ │ │ └── sys_arch.h │ │ ├── lwip_logging.cpp │ │ ├── lwip_logging.h │ │ ├── lwiphooks.h │ │ ├── lwipopts.h │ │ ├── lwippools.h │ │ ├── lwippppopts.h │ │ └── sys_arch.c │ ├── mbedtls │ │ ├── aes_alt.c │ │ ├── aes_alt.h │ │ ├── aes_alt_cc310.c │ │ ├── aes_alt_cc310.h │ │ ├── aes_alt_soft.c │ │ ├── aes_alt_soft.h │ │ ├── cc310_mbedtls.cpp │ │ ├── cc310_mbedtls.h │ │ ├── crypto.cpp │ │ ├── ecp_alt.h │ │ ├── ecp_alt_cc310.c │ │ ├── ecp_curves_alt.c │ │ ├── ecp_curves_enable.c │ │ ├── mbedtls_config_platform.h │ │ ├── sha1_alt.h │ │ ├── sha1_alt_cc310.c │ │ ├── sha256_alt.h │ │ ├── sha256_alt_cc310.c │ │ └── sha512_disable.c │ ├── memory_hal.cpp │ ├── mesh_hal_deprecated.cpp │ ├── miniz_config.h │ ├── newlib.cpp │ ├── nfc_hal.cpp │ ├── nrf_system_error.cpp │ ├── nrf_system_error.h │ ├── ota_flash_hal.cpp │ ├── ota_flash_hal_impl.h │ ├── ota_module.cpp │ ├── ota_module.h │ ├── ota_module_bounds.c │ ├── pinmap_hal.c │ ├── pinmap_impl.h │ ├── platform_headers.h │ ├── platform_radio_stack.cpp │ ├── posix │ │ ├── sys │ │ │ └── dirent.h │ │ └── syscalls_posix.cpp │ ├── product_store_hal.cpp │ ├── pwm_hal.cpp │ ├── radio_common.cpp │ ├── radio_common.h │ ├── readme.md │ ├── resources.md │ ├── rgbled_hal.c │ ├── rgbled_hal_impl.h │ ├── rng_hal.cpp │ ├── rtc_hal.cpp │ ├── rtos_hook.cpp │ ├── serial_stream.cpp │ ├── serial_stream.h │ ├── servo_hal.cpp │ ├── sleep_hal.cpp │ ├── sources.mk │ ├── spi_hal.cpp │ ├── static_recursive_mutex.h │ ├── storage_hal.cpp │ ├── syshealth_hal.cpp │ ├── system_interrupts.cpp │ ├── timer_hal.cpp │ ├── tlm.mk │ ├── tone_hal.cpp │ ├── usart_hal.cpp │ ├── usb_hal.cpp │ ├── usb_hal_cdc.c │ ├── usb_hal_cdc.h │ ├── usb_hal_control.cpp │ ├── usb_hal_hid.cpp │ ├── usb_settings.h │ ├── usbd_wcid.h │ ├── user_hal.cpp │ └── watchdog_hal.cpp │ ├── newhal │ ├── bootloader.h │ ├── button_hal_impl.h │ ├── concurrent_hal_impl.h │ ├── dct.h │ ├── deviceid_hal_impl.h │ ├── eeprom_emulation_impl.h │ ├── filesystem_impl.h │ ├── flash_storage_impl.h │ ├── hal_platform_config.h │ ├── include.mk │ ├── interrupts_irq.h │ ├── lfs_config.h │ ├── linker.ld │ ├── mbedtls_config_platform.h │ ├── miniz_config.h │ ├── ota_flash_hal_impl.h │ ├── ota_module.h │ ├── pinmap_impl.h │ ├── platform_config.h │ ├── platform_headers.h │ ├── readme.md │ ├── rgbled_hal_impl.h │ ├── sources.mk │ ├── static_recursive_mutex.h │ └── tlm.mk │ ├── portable │ └── FreeRTOS │ │ ├── bits │ │ ├── gthr-default.h │ │ └── gthr.cpp │ │ ├── heap_4_lock.c │ │ ├── heap_5_lock.c │ │ └── heap_portable.h │ ├── rtl872x │ ├── adc_hal.cpp │ ├── backup_ram_hal.cpp │ ├── bkpreg_hal.c │ ├── ble_hal.cpp │ ├── ble_hal_impl.h │ ├── bootloader.cpp │ ├── bootloader_hal.c │ ├── button_hal.cpp │ ├── button_hal_impl.h │ ├── can_hal.cpp │ ├── concurrent_hal.cpp │ ├── concurrent_hal_impl.h │ ├── core_hal.c │ ├── core_subsys_hal.cpp │ ├── cxx_constructors.cpp │ ├── dac_hal.cpp │ ├── dct_hal.cpp │ ├── dct_hal.h │ ├── dct_hal_lock.cpp │ ├── delay_hal.cpp │ ├── device_code.cpp │ ├── deviceid_hal.cpp │ ├── deviceid_hal_impl.h │ ├── eeprom_hal.cpp │ ├── eeprom_hal_impl.h │ ├── efuse.cpp │ ├── efuse.h │ ├── event_group_stream.h │ ├── exflash_hal.cpp │ ├── exflash_hal_lock.cpp │ ├── exrtc_hal.cpp │ ├── flash_hal.c │ ├── free_worker.h │ ├── freertos │ │ ├── FreeRTOSConfig.h │ │ └── FreeRTOSConfig_m23.h │ ├── gpio_hal.cpp │ ├── gsm0710muxer │ │ ├── channel_stream.h │ │ └── platform.h │ ├── hal_dynalib_export.cpp │ ├── hal_event.cpp │ ├── hal_irq_flag.c │ ├── hal_platform_rtl8721x_config.h │ ├── i2c_hal.cpp │ ├── image_bootloader.sh │ ├── include.mk │ ├── inet_hal_compat.cpp │ ├── interrupts_hal.cpp │ ├── interrupts_irq.h │ ├── km0_km4_ipc.cpp │ ├── km0_km4_ipc.h │ ├── linker.ld │ ├── littlefs │ │ ├── filesystem_impl.h │ │ ├── lfs_config.h │ │ └── lfs_utils.cpp │ ├── lwip │ │ ├── arch │ │ │ ├── cc.h │ │ │ └── sys_arch.h │ │ ├── lwip_logging.cpp │ │ ├── lwip_logging.h │ │ ├── lwip_rltk.h │ │ ├── lwip_rtlk.cpp │ │ ├── lwiphooks.h │ │ ├── lwipopts.h │ │ ├── lwippools.h │ │ ├── lwippppopts.h │ │ └── sys_arch.c │ ├── mbedtls │ │ ├── cc310_mbedtls.cpp │ │ └── mbedtls_config_platform.h │ ├── miniz_config.h │ ├── newlib.cpp │ ├── ota_flash_hal.cpp │ ├── ota_flash_hal_impl.h │ ├── ota_module.cpp │ ├── ota_module.h │ ├── ota_module_bounds.c │ ├── pinmap_hal.cpp │ ├── pinmap_impl.h │ ├── platform_headers.h │ ├── platform_radio_stack.cpp │ ├── posix │ │ ├── sys │ │ │ └── dirent.h │ │ └── syscalls_posix.cpp │ ├── product_store_hal.cpp │ ├── pwm_hal.cpp │ ├── radio_common.cpp │ ├── radio_common.h │ ├── readme.md │ ├── resources.md │ ├── rgbled_hal.cpp │ ├── rgbled_hal_impl.h │ ├── rng_hal.cpp │ ├── rtc_hal.cpp │ ├── rtl_osdep.cpp │ ├── rtl_power_table.c │ ├── rtl_sdk_support.cpp │ ├── rtl_sdk_support.h │ ├── rtl_system_error.cpp │ ├── rtl_system_error.h │ ├── rtos_hook.cpp │ ├── serial_stream.cpp │ ├── serial_stream.h │ ├── servo_hal.cpp │ ├── sleep_hal.cpp │ ├── sources.mk │ ├── spi_hal.cpp │ ├── static_recursive_mutex.h │ ├── storage_hal.cpp │ ├── syshealth_hal.cpp │ ├── system_interrupts.cpp │ ├── timer_hal.cpp │ ├── tlm.mk │ ├── tone_hal.cpp │ ├── usart_hal.cpp │ ├── usb_hal.cpp │ ├── usb_hal_hid.cpp │ ├── usb_settings.h │ ├── usbd_cdc.cpp │ ├── usbd_cdc.h │ ├── usbd_control.cpp │ ├── usbd_control.h │ ├── usbd_device.cpp │ ├── usbd_device.h │ ├── usbd_driver.cpp │ ├── usbd_driver.h │ ├── usbd_hid.cpp │ ├── usbd_hid.h │ ├── usbd_wcid.h │ ├── user.h │ ├── user_hal.cpp │ └── watchdog_hal.cpp │ ├── template │ ├── adc_hal.cpp │ ├── can_hal.cpp │ ├── core_hal.cpp │ ├── core_subsys_hal.cpp │ ├── dac_hal.cpp │ ├── delay_hal.cpp │ ├── deviceid_hal.cpp │ ├── eeprom_hal.cpp │ ├── gpio_hal.cpp │ ├── i2c_hal.cpp │ ├── inet_hal.cpp │ ├── interrupts_hal.cpp │ ├── memory_hal.cpp │ ├── ota_flash_hal.cpp │ ├── pinmap_hal.cpp │ ├── platform_headers.h │ ├── product_store_hal.cpp │ ├── pwm_hal.cpp │ ├── rng_hal.cpp │ ├── rtc_hal.cpp │ ├── servo_hal.cpp │ ├── sleep_hal.cpp │ ├── socket_hal.cpp │ ├── sources.mk │ ├── spi_hal.cpp │ ├── storage_hal.cpp │ ├── syshealth_hal.cpp │ ├── timer_hal.cpp │ ├── tone_hal.cpp │ ├── usart_hal.cpp │ ├── usb_hal.cpp │ ├── watchdog_hal.cpp │ └── wlan_hal.cpp │ ├── tracker │ ├── am18x5.cpp │ ├── am18x5.h │ ├── am18x5_defines.h │ ├── app_usbd_string_config.h │ ├── bootloader_platform_26.c │ ├── esp32_sdio_stream.cpp │ ├── esp32_sdio_stream.h │ ├── hal_platform_config.h │ ├── include.mk │ ├── network │ │ └── network.cpp │ ├── ota_flash_hal.cpp │ ├── pinmap_defines.h │ ├── pinmap_hal.c │ ├── platform_ncp_quectel.cpp │ ├── sdspi │ │ ├── esp32_sdio.cpp │ │ ├── esp32_sdio.h │ │ ├── port.cpp │ │ ├── port.h │ │ ├── sdspi_host.c │ │ └── sdspi_host.h │ ├── sources.mk │ ├── tlm.mk │ └── user_platform_26.c │ ├── trackerm │ ├── hal_platform_config.h │ ├── include.mk │ ├── network │ │ └── network.cpp │ ├── ota_flash_hal.cpp │ ├── pinmap_defines.cpp │ ├── pinmap_defines.h │ ├── platform_ncp_quectel.cpp │ ├── sources.mk │ └── tlm.mk │ └── tron │ ├── hal_platform_config.h │ ├── include.mk │ ├── network │ └── network.cpp │ ├── ota_flash_hal.cpp │ ├── pinmap_defines.cpp │ ├── pinmap_defines.h │ ├── platform_ncp.cpp │ ├── sources.mk │ └── tlm.mk ├── main ├── build.mk ├── import.mk ├── makefile └── src │ ├── build.mk │ └── module_info.c ├── makefile ├── modules ├── argon │ ├── makefile │ ├── modular.mk │ ├── system-part1 │ │ ├── build.mk │ │ ├── import.mk │ │ ├── linker.ld │ │ ├── makefile │ │ ├── module_system_part1_export.ld │ │ └── src │ │ │ ├── export_rt.c │ │ │ ├── export_system.cpp │ │ │ ├── import_user.c │ │ │ ├── import_user_compat.c │ │ │ ├── module_info.c │ │ │ └── module_system_part1.cpp │ └── user-part │ │ ├── build.mk │ │ ├── import.mk │ │ ├── linker.ld │ │ ├── makefile │ │ ├── module_user_export.ld │ │ └── src │ │ ├── module_info.c │ │ ├── newlib_stubs.cpp │ │ ├── user_export.c │ │ └── user_module.c ├── b5som │ ├── makefile │ ├── modular.mk │ ├── system-part1 │ │ ├── build.mk │ │ ├── import.mk │ │ ├── linker.ld │ │ ├── makefile │ │ ├── module_system_part1_export.ld │ │ └── src │ │ │ ├── export_rt.c │ │ │ ├── export_system.cpp │ │ │ ├── import_user.c │ │ │ ├── import_user_compat.c │ │ │ ├── module_info.c │ │ │ └── module_system_part1.cpp │ └── user-part │ │ ├── build.mk │ │ ├── import.mk │ │ ├── linker.ld │ │ ├── makefile │ │ ├── module_user_export.ld │ │ └── src │ │ ├── module_info.c │ │ ├── newlib_stubs.cpp │ │ ├── user_export.c │ │ └── user_module.c ├── boron │ ├── makefile │ ├── modular.mk │ ├── system-part1 │ │ ├── build.mk │ │ ├── import.mk │ │ ├── linker.ld │ │ ├── makefile │ │ ├── module_system_part1_export.ld │ │ └── src │ │ │ ├── export_rt.c │ │ │ ├── export_system.cpp │ │ │ ├── import_user.c │ │ │ ├── import_user_compat.c │ │ │ ├── module_info.c │ │ │ └── module_system_part1.cpp │ └── user-part │ │ ├── build.mk │ │ ├── import.mk │ │ ├── linker.ld │ │ ├── makefile │ │ ├── module_user_export.ld │ │ └── src │ │ ├── module_info.c │ │ ├── newlib_stubs.cpp │ │ ├── user_export.c │ │ └── user_module.c ├── electron2 │ ├── makefile │ ├── modular.mk │ ├── system-part1 │ │ ├── build.mk │ │ ├── import.mk │ │ ├── linker.ld │ │ ├── makefile │ │ ├── module_system_part1_export.ld │ │ └── src │ │ │ ├── export_rt.c │ │ │ ├── export_system.cpp │ │ │ ├── import_user.c │ │ │ ├── import_user_compat.c │ │ │ ├── module_info.c │ │ │ └── module_system_part1.cpp │ └── user-part │ │ ├── build.mk │ │ ├── import.mk │ │ ├── linker.ld │ │ ├── makefile │ │ ├── module_user_export.ld │ │ └── src │ │ ├── module_info.c │ │ ├── newlib_stubs.cpp │ │ ├── user_export.c │ │ └── user_module.c ├── makefile ├── msom │ ├── makefile │ ├── modular.mk │ ├── system-part1 │ │ ├── build.mk │ │ ├── import.mk │ │ ├── linker.ld │ │ ├── makefile │ │ ├── module_system_part1_export.ld │ │ └── src │ │ │ ├── export_rt.c │ │ │ ├── export_system.cpp │ │ │ ├── import_user.c │ │ │ ├── import_user_preinit.c │ │ │ ├── module_info.c │ │ │ └── module_system_part1.cpp │ └── user-part │ │ ├── build.mk │ │ ├── import.mk │ │ ├── linker.ld │ │ ├── makefile │ │ ├── module_user_export.ld │ │ └── src │ │ ├── module_info.c │ │ ├── newlib_stubs.cpp │ │ ├── user_export.c │ │ └── user_module.c ├── shared │ ├── nRF52840 │ │ ├── build_linker_script.mk │ │ ├── inc │ │ │ ├── module_user_init.h │ │ │ ├── system-part1 │ │ │ │ ├── export_rt.inc │ │ │ │ ├── export_system.inc │ │ │ │ ├── import_user.inc │ │ │ │ ├── import_user_compat.inc │ │ │ │ └── module_system_part1.inc │ │ │ ├── system_part1_loader.c │ │ │ ├── user-part │ │ │ │ ├── newlib_stubs.inc │ │ │ │ ├── user_export.inc │ │ │ │ └── user_module.inc │ │ │ ├── user_dynalib.h │ │ │ ├── user_dynalib_compat.h │ │ │ └── user_part_export.c │ │ ├── include.mk │ │ ├── linker_system_part1_common.ld │ │ ├── linker_user_part_common.ld │ │ ├── part1_build.mk │ │ └── user_build.mk │ ├── rtl872x │ │ ├── build_linker_script.mk │ │ ├── inc │ │ │ ├── module_user_init.h │ │ │ ├── system-part1 │ │ │ │ ├── export_rt.inc │ │ │ │ ├── export_system.inc │ │ │ │ ├── import_user.inc │ │ │ │ ├── import_user_preinit.inc │ │ │ │ └── module_system_part1.inc │ │ │ ├── system_part1_loader.c │ │ │ ├── user-part │ │ │ │ ├── newlib_stubs.inc │ │ │ │ ├── user_export.inc │ │ │ │ └── user_module.inc │ │ │ ├── user_dynalib.h │ │ │ ├── user_part_export.c │ │ │ └── user_preinit_dynalib.h │ │ ├── include.mk │ │ ├── linker_system_part1_common.ld │ │ ├── linker_user_part_common.ld │ │ ├── part1_build.mk │ │ └── user_build.mk │ └── system_module_version.mk ├── tracker │ ├── makefile │ ├── modular.mk │ ├── system-part1 │ │ ├── build.mk │ │ ├── import.mk │ │ ├── linker.ld │ │ ├── makefile │ │ ├── module_system_part1_export.ld │ │ └── src │ │ │ ├── export_rt.c │ │ │ ├── export_system.cpp │ │ │ ├── import_user.c │ │ │ ├── import_user_compat.c │ │ │ ├── module_info.c │ │ │ └── module_system_part1.cpp │ └── user-part │ │ ├── build.mk │ │ ├── import.mk │ │ ├── linker.ld │ │ ├── makefile │ │ ├── module_user_export.ld │ │ └── src │ │ ├── module_info.c │ │ ├── newlib_stubs.cpp │ │ ├── user_export.c │ │ └── user_module.c ├── trackerm │ ├── makefile │ ├── modular.mk │ ├── system-part1 │ │ ├── build.mk │ │ ├── import.mk │ │ ├── linker.ld │ │ ├── makefile │ │ ├── module_system_part1_export.ld │ │ └── src │ │ │ ├── export_rt.c │ │ │ ├── export_system.cpp │ │ │ ├── import_user.c │ │ │ ├── import_user_preinit.c │ │ │ ├── module_info.c │ │ │ └── module_system_part1.cpp │ └── user-part │ │ ├── build.mk │ │ ├── import.mk │ │ ├── linker.ld │ │ ├── makefile │ │ ├── module_user_export.ld │ │ └── src │ │ ├── module_info.c │ │ ├── newlib_stubs.cpp │ │ ├── user_export.c │ │ └── user_module.c └── tron │ ├── makefile │ ├── modular.mk │ ├── system-part1 │ ├── build.mk │ ├── import.mk │ ├── linker.ld │ ├── makefile │ ├── module_system_part1_export.ld │ └── src │ │ ├── export_rt.c │ │ ├── export_system.cpp │ │ ├── import_user.c │ │ ├── import_user_preinit.c │ │ ├── module_info.c │ │ └── module_system_part1.cpp │ └── user-part │ ├── build.mk │ ├── import.mk │ ├── linker.ld │ ├── makefile │ ├── module_user_export.ld │ └── src │ ├── module_info.c │ ├── newlib_stubs.cpp │ ├── user_export.c │ └── user_module.c ├── newlib_nano ├── build.mk ├── import.mk ├── makefile └── src │ ├── custom-nano-4.8.4.specs │ ├── custom-nano.specs │ ├── malloc.cpp │ └── sources.mk ├── platform ├── MCU │ ├── build.mk │ ├── gcc │ │ ├── inc │ │ │ ├── flash_mal.h │ │ │ ├── hw_config.h │ │ │ ├── include.mk │ │ │ └── platform_config.h │ │ ├── include.mk │ │ ├── src │ │ │ ├── hw_config.c │ │ │ └── sources.mk │ │ └── tlm.mk │ ├── nRF52840 │ │ ├── inc │ │ │ ├── dct.h │ │ │ ├── flash_access.h │ │ │ ├── flash_acquire.h │ │ │ ├── flash_mal.h │ │ │ ├── hw_config.h │ │ │ ├── hw_system_flags.h │ │ │ ├── hw_ticks.h │ │ │ ├── include.mk │ │ │ ├── legacy │ │ │ │ └── apply_old_config.h │ │ │ ├── nrf_log_instance.h │ │ │ ├── nrfx_config.h │ │ │ ├── nrfx_glue.h │ │ │ ├── nrfx_log.h │ │ │ ├── nrfx_types.h │ │ │ ├── periph_lock.h │ │ │ ├── platform_config.h │ │ │ ├── platform_flash_modules.h │ │ │ ├── platform_system_flags.h │ │ │ ├── sdk_config.h │ │ │ ├── sdk_config_bootloader.h │ │ │ └── sdk_config_system.h │ │ ├── include.mk │ │ ├── src │ │ │ ├── flash_mal.c │ │ │ ├── hw_config.c │ │ │ ├── hw_system_flags.c │ │ │ ├── hw_ticks.c │ │ │ └── sources.mk │ │ └── tlm.mk │ ├── newhal-mcu │ │ ├── inc │ │ │ ├── flash_mal.h │ │ │ ├── hw_config.h │ │ │ ├── hw_ticks.h │ │ │ └── include.mk │ │ ├── include.mk │ │ ├── src │ │ │ ├── hw_config.c │ │ │ └── sources.mk │ │ └── tlm.mk │ └── rtl872x │ │ ├── inc │ │ ├── boot_info.h │ │ ├── build_info.h │ │ ├── customer_rtos_service.h │ │ ├── dct.h │ │ ├── diag.h │ │ ├── flash_access.h │ │ ├── flash_acquire.h │ │ ├── flash_mal.h │ │ ├── hw_config.h │ │ ├── hw_system_flags.h │ │ ├── hw_ticks.h │ │ ├── include.mk │ │ ├── main.h │ │ ├── memproc.h │ │ ├── periph_lock.h │ │ ├── platform_autoconf.h │ │ ├── platform_autoconf_m23.h │ │ ├── platform_config.h │ │ ├── platform_flash_modules.h │ │ ├── platform_opts.h │ │ ├── platform_opts_bt.h │ │ ├── platform_opts_m23.h │ │ ├── platform_stdlib_customer.h │ │ ├── platform_system_flags.h │ │ ├── rand.h │ │ ├── rtl_header.h │ │ ├── strproc.h │ │ ├── va_list.h │ │ └── xmodem_update_rom.h │ │ ├── include.mk │ │ ├── src │ │ ├── flash_mal.c │ │ ├── hw_config.c │ │ ├── hw_system_flags.c │ │ ├── hw_ticks.c │ │ └── sources.mk │ │ └── tlm.mk ├── NET │ └── build.mk ├── import.mk └── makefile ├── proto_defs ├── .gitignore ├── build.mk ├── gen_proto.sh ├── import.mk ├── include.mk ├── internal │ ├── ledger.proto │ └── network_config.proto ├── makefile └── src │ ├── cloud │ ├── cloud.pb.c │ ├── cloud.pb.h │ ├── describe.pb.c │ ├── describe.pb.h │ ├── ledger.pb.c │ └── ledger.pb.h │ ├── control │ ├── cellular.pb.c │ ├── cellular.pb.h │ ├── cloud.pb.c │ ├── cloud.pb.h │ ├── common.pb.c │ ├── common.pb.h │ ├── config.pb.c │ ├── config.pb.h │ ├── extensions.pb.c │ ├── extensions.pb.h │ ├── network.pb.c │ ├── network.pb.h │ ├── network_old.pb.c │ ├── network_old.pb.h │ ├── storage.pb.c │ ├── storage.pb.h │ ├── wifi.pb.c │ ├── wifi.pb.h │ ├── wifi_new.pb.c │ └── wifi_new.pb.h │ ├── ledger.pb.c │ ├── ledger.pb.h │ ├── network_config.pb.c │ └── network_config.pb.h ├── rt-dynalib ├── import.mk ├── inc │ └── rt_dynalib.h ├── makefile └── src │ ├── build.mk │ └── rt_dynalib.c ├── scripts ├── docker-hub-login ├── flash.sh ├── init_km0.gdb ├── init_km4.gdb ├── rtl872x.tcl ├── rtl872x_km0_debug.tcl ├── rtl872x_km4_debug.tcl └── target │ └── rtl872x.tcl ├── services-dynalib ├── import.mk ├── makefile ├── readme.md └── src │ ├── build.mk │ └── services_dynalib.c ├── services ├── import.mk ├── inc │ ├── addr_util.h │ ├── align_util.h │ ├── allocator.h │ ├── appender.h │ ├── atomic_flag_mutex.h │ ├── atomic_section.h │ ├── bcd_to_dec.h │ ├── bytes2hexbuf.h │ ├── c_string.h │ ├── check.h │ ├── combine_hash.h │ ├── completion_handler.h │ ├── config.h │ ├── dct_file.h │ ├── debug.h │ ├── debug_util.h │ ├── devicetree_stubs.h │ ├── diagnostics.h │ ├── eeprom_emulation.h │ ├── endian_util.h │ ├── enumclass.h │ ├── enumflags.h │ ├── file_util.h │ ├── fixed_queue.h │ ├── flash_storage.h │ ├── hex_to_bytes.h │ ├── icmp_echo.h │ ├── include.mk │ ├── intrusive_list.h │ ├── intrusive_queue.h │ ├── jsmn.h │ ├── jsmn_compat.h │ ├── led_service.h │ ├── linked_buffer.h │ ├── logging.h │ ├── nanopb_misc.h │ ├── panic.h │ ├── preprocessor.h │ ├── printf_export.h │ ├── random.h │ ├── ref_count.h │ ├── rgbled.h │ ├── ringbuf_helper.h │ ├── ringbuffer.h │ ├── runnable.h │ ├── scope_guard.h │ ├── security_mode.h │ ├── service_debug.h │ ├── services_dynalib.h │ ├── sha256.h │ ├── simple_file_storage.h │ ├── simple_pool_allocator.h │ ├── softcrc32.h │ ├── spark_macros.h │ ├── static_assert.h │ ├── storage_streams.h │ ├── str_compat.h │ ├── str_util.h │ ├── stream.h │ ├── stream_util.h │ ├── system_cache.h │ ├── system_defs.h │ ├── system_error.h │ ├── test_malloc.h │ ├── thread_runner.h │ ├── time_util.h │ ├── tlv_file.h │ ├── underlying_type.h │ ├── varint.h │ └── xmodem_sender.h ├── makefile ├── readme.md └── src │ ├── addr_util.cpp │ ├── build.mk │ ├── completion_handler.cpp │ ├── debug.c │ ├── debug_util.cpp │ ├── devicetree_stubs.cpp │ ├── diagnostics.cpp │ ├── file_util.cpp │ ├── jsmn.c │ ├── jsmn_compat.c │ ├── led_service.cpp │ ├── logging.cpp │ ├── nanopb_misc.c │ ├── panic.c │ ├── printf_export.c │ ├── rgbled.c │ ├── scanf_export.c │ ├── security_mode.cpp │ ├── services_dynalib.c │ ├── simple_file_storage.cpp │ ├── str_compat.cpp │ ├── str_util.cpp │ ├── stream.cpp │ ├── stream_util.cpp │ ├── system_cache.cpp │ ├── system_error.cpp │ ├── thread_runner.cpp │ ├── tlv_file.cpp │ └── xmodem_sender.cpp ├── system-dynalib ├── import.mk ├── makefile └── src │ ├── build.mk │ ├── system_dynalib.c │ ├── system_dynalib_asset_manager.c │ ├── system_dynalib_cloud.c │ ├── system_dynalib_ledger.c │ └── system_dynalib_net.c ├── system ├── import.mk ├── inc │ ├── active_object.h │ ├── asset_manager.h │ ├── asset_manager_api.h │ ├── include.mk │ ├── system_ble_prov.h │ ├── system_cloud.h │ ├── system_control.h │ ├── system_dynalib.h │ ├── system_dynalib_asset_manager.h │ ├── system_dynalib_cloud.h │ ├── system_dynalib_ledger.h │ ├── system_dynalib_net.h │ ├── system_event.h │ ├── system_info.h │ ├── system_info_encoding.h │ ├── system_led_signal.h │ ├── system_ledger.h │ ├── system_mode.h │ ├── system_network.h │ ├── system_network_configuration.h │ ├── system_power.h │ ├── system_setup.h │ ├── system_sleep.h │ ├── system_sleep_configuration.h │ ├── system_string_interpolate.h │ ├── system_task.h │ ├── system_threading.h │ ├── system_update.h │ ├── system_user.h │ └── system_version.h ├── makefile ├── src │ ├── active_object.cpp │ ├── asset_manager.cpp │ ├── asset_manager_api.cpp │ ├── ble_control_request_channel.cpp │ ├── ble_control_request_channel.h │ ├── ble_provisioning_mode_handler.cpp │ ├── ble_provisioning_mode_handler.h │ ├── build.mk │ ├── control │ │ ├── cellular.cpp │ │ ├── cellular.h │ │ ├── cloud.cpp │ │ ├── cloud.h │ │ ├── common.cpp │ │ ├── common.h │ │ ├── config.cpp │ │ ├── config.h │ │ ├── network.cpp │ │ ├── network.h │ │ ├── storage.cpp │ │ ├── storage.h │ │ ├── wifi_new.cpp │ │ └── wifi_new.h │ ├── control_request_handler.cpp │ ├── control_request_handler.h │ ├── firmware_update.cpp │ ├── firmware_update.h │ ├── ledger │ │ ├── ledger.cpp │ │ ├── ledger.h │ │ ├── ledger_manager.cpp │ │ ├── ledger_manager.h │ │ ├── ledger_util.cpp │ │ └── ledger_util.h │ ├── main.cpp │ ├── server_config.cpp │ ├── server_config.h │ ├── system_ble_prov.cpp │ ├── system_cloud.cpp │ ├── system_cloud_connection.cpp │ ├── system_cloud_connection.h │ ├── system_cloud_connection_compat.cpp │ ├── system_cloud_connection_posix.cpp │ ├── system_cloud_internal.cpp │ ├── system_cloud_internal.h │ ├── system_connection_manager.cpp │ ├── system_connection_manager.h │ ├── system_control_internal.cpp │ ├── system_control_internal.h │ ├── system_event.cpp │ ├── system_info.cpp │ ├── system_info_encoding.cpp │ ├── system_led_signal.cpp │ ├── system_ledger.cpp │ ├── system_listening_mode.cpp │ ├── system_listening_mode.h │ ├── system_mode.cpp │ ├── system_network_cellular.cpp │ ├── system_network_cellular.h │ ├── system_network_compat.cpp │ ├── system_network_diagnostics.cpp │ ├── system_network_diagnostics.h │ ├── system_network_internal.cpp │ ├── system_network_internal.h │ ├── system_network_manager.cpp │ ├── system_network_manager.h │ ├── system_network_manager_api.cpp │ ├── system_network_wifi.h │ ├── system_power.cpp │ ├── system_power_manager.cpp │ ├── system_power_manager.h │ ├── system_publish_vitals.cpp │ ├── system_publish_vitals.h │ ├── system_setup.cpp │ ├── system_sleep.cpp │ ├── system_sleep_compat.cpp │ ├── system_string_interpolate.cpp │ ├── system_task.cpp │ ├── system_threading.cpp │ ├── system_update.cpp │ ├── system_utilities.cpp │ ├── usb_control_request_channel.cpp │ ├── usb_control_request_channel.h │ └── util │ │ ├── system_timer.cpp │ │ └── system_timer.h ├── system-flags.md ├── system-threading.md └── system-versions.md ├── test └── unit_tests │ ├── .gitignore │ ├── CMakeLists.txt │ ├── README.md │ ├── cellular │ ├── CMakeLists.txt │ └── cellular.cpp │ ├── cloud │ ├── CMakeLists.txt │ └── publish_vitals.cpp │ ├── communication │ ├── CMakeLists.txt │ ├── coap.cpp │ ├── coap_message_decoder.cpp │ ├── coap_message_encoder.cpp │ ├── coap_reliability.cpp │ ├── description.cpp │ ├── firmware_update.cpp │ ├── forward_message_channel.cpp │ ├── forward_message_channel.h │ ├── hal_stubs.cpp │ ├── messages.cpp │ ├── ping.cpp │ ├── protocol.cpp │ ├── publisher.cpp │ └── util │ │ ├── coap_message.cpp │ │ ├── coap_message.h │ │ ├── coap_message_channel.cpp │ │ ├── coap_message_channel.h │ │ ├── descriptor_callbacks.cpp │ │ ├── descriptor_callbacks.h │ │ ├── protocol_callbacks.cpp │ │ ├── protocol_callbacks.h │ │ ├── protocol_stub.cpp │ │ └── protocol_stub.h │ ├── hal │ ├── CMakeLists.txt │ ├── inflate.cpp │ ├── simple_ntp_client │ │ ├── CMakeLists.txt │ │ ├── compat │ │ │ ├── CMakeLists.txt │ │ │ ├── hal_stubs.cpp │ │ │ └── simple_ntp_client.cpp │ │ └── posix │ │ │ ├── CMakeLists.txt │ │ │ ├── hal_stubs.cpp │ │ │ ├── ifapi_impl.h │ │ │ ├── inet_hal_posix_impl.h │ │ │ ├── netdb_hal_impl.h │ │ │ ├── simple_ntp_client.cpp │ │ │ └── socket_hal_posix_impl.h │ └── sparse_buffer.cpp │ ├── mock │ ├── alloc.h │ ├── control.h │ ├── core_hal_mock.cpp │ ├── core_hal_mock.h │ ├── dct_hal_mock.cpp │ ├── dct_hal_mock.h │ ├── filesystem.cpp │ ├── filesystem.h │ ├── mbedtls_mock.cpp │ ├── mbedtls_mock.h │ ├── mock_types.h │ ├── system_info_mock.cpp │ └── system_info_mock.h │ ├── services │ ├── CMakeLists.txt │ ├── diagnostics.cpp │ ├── eeprom_emulation.cpp │ ├── fixed_queue.cpp │ ├── fixtures │ │ ├── corrupted_eeprom_page1.bin │ │ ├── corrupted_eeprom_page2.bin │ │ └── eeprom_page1.bin │ ├── led_service.cpp │ ├── logging │ │ ├── CMakeLists.txt │ │ ├── logging.cpp │ │ └── main.cpp │ ├── main.cpp │ ├── pool_allocator.cpp │ ├── rgbled.cpp │ ├── service_bytes2hex.cpp │ ├── simple_file_storage.cpp │ ├── str_util.cpp │ └── varint.cpp │ ├── stub │ ├── core_hal.cpp │ ├── dct.h │ ├── dct_hal.cpp │ ├── dct_hal.h │ ├── filesystem.cpp │ ├── filesystem.h │ ├── inet_hal_compat.cpp │ ├── mbedtls │ │ ├── asn1.cpp │ │ ├── asn1.h │ │ ├── md.cpp │ │ ├── md.h │ │ ├── pk.cpp │ │ └── pk.h │ ├── mbedtls_config.h │ ├── mbedtls_util.cpp │ ├── security_mode.cpp │ ├── system_cloud.cpp │ ├── system_cloud_internal.cpp │ ├── system_control.cpp │ ├── system_mode.cpp │ ├── system_network.cpp │ ├── system_pool.cpp │ ├── system_threading.h │ └── test_malloc.cpp │ ├── system │ ├── CMakeLists.txt │ ├── module_info.c │ ├── server_config.cpp │ ├── string_interpolate.cpp │ ├── stubs.cpp │ ├── system_info.cpp │ ├── system_task.cpp │ └── usb_control_request_channel.cpp │ ├── util │ ├── alloc.cpp │ ├── alloc.h │ ├── buffer.cpp │ ├── buffer.h │ ├── catch.h │ ├── check.h │ ├── dump.h │ ├── random.cpp │ ├── random.h │ ├── random_old.cpp │ ├── random_old.h │ ├── stream.h │ ├── string.cpp │ ├── string.h │ └── string_appender.h │ └── wiring │ ├── CMakeLists.txt │ ├── async.cpp │ ├── buffer.cpp │ ├── character.cpp │ ├── error.cpp │ ├── flags.cpp │ ├── fuel_gauge.cpp │ ├── ipaddress.cpp │ ├── json.cpp │ ├── map.cpp │ ├── print.cpp │ ├── print2.cpp │ ├── random.cpp │ ├── std_functions.cpp │ ├── string.cpp │ ├── variant.cpp │ ├── vector.cpp │ └── wlan.cpp ├── third_party ├── ambd_sdk │ ├── build.mk │ ├── import.mk │ ├── include.mk │ └── makefile ├── coremark │ ├── Makefile │ ├── build.mk │ ├── import.mk │ └── include.mk ├── freertos │ ├── build.mk │ ├── import.mk │ ├── include.mk │ └── makefile ├── hippomocks │ └── hippomocks.h ├── littlefs │ ├── build.mk │ ├── import.mk │ ├── include.mk │ └── makefile ├── lwip │ ├── build.mk │ ├── import.mk │ ├── include.mk │ └── makefile ├── mbedtls │ ├── build.mk │ ├── import.mk │ ├── include.mk │ └── makefile ├── miniz │ ├── Makefile │ ├── build.mk │ ├── import.mk │ └── include.mk ├── nanopb │ ├── build.mk │ ├── import.mk │ ├── include.mk │ └── makefile ├── nrf5_sdk │ ├── build.mk │ ├── import.mk │ ├── include.mk │ └── makefile └── wiznet_driver │ ├── build.mk │ ├── import.mk │ ├── include.mk │ └── makefile ├── user ├── .gitignore ├── applications │ ├── antselect │ │ └── application.cpp │ ├── can │ │ └── application.cpp │ ├── force_safe_mode │ │ └── application.cpp │ ├── hw_serial2 │ │ └── app.cpp │ ├── mfg-test │ │ ├── FactoryTester.cpp │ │ ├── FactoryTester.h │ │ ├── TesterCommandTypes.h │ │ └── gen3-mfg-test.cpp │ ├── otastress │ │ ├── otastress.cpp │ │ ├── otastress.sh │ │ └── readme.md │ ├── product_id_and_version │ │ └── application.cpp │ ├── serialbridge │ │ └── bridge.cpp │ ├── tinker-serial-debugging │ │ └── tinker-serial-debugging.mk │ ├── tinker-serial1-debugging │ │ └── tinker-serial1-debugging.mk │ ├── tinker │ │ ├── application.cpp │ │ ├── include.mk │ │ ├── request_handler.cpp │ │ ├── request_handler.h │ │ ├── src │ │ │ ├── board_config.cpp │ │ │ ├── board_config.h │ │ │ ├── burnin_test.cpp │ │ │ ├── burnin_test.h │ │ │ ├── fqc_test.cpp │ │ │ └── fqc_test.h │ │ └── tinker.mk │ └── unlocker │ │ └── unlocker.cpp ├── build.mk ├── import.mk ├── inc │ ├── Arduino.h │ ├── Particle.h │ ├── Print.h │ ├── SPI.h │ ├── Stream.h │ ├── WProgram.h │ ├── WString.h │ ├── Wire.h │ ├── application.h │ └── include.mk ├── libraries │ ├── Serial2 │ │ ├── .Serial2.h.swp │ │ └── Serial2.h │ ├── Serial3 │ │ └── Serial3.h │ ├── Serial4 │ │ └── Serial4.h │ ├── Serial5 │ │ └── Serial5.h │ └── Ymodem │ │ └── Ymodem.h ├── makefile ├── src │ └── application.cpp └── tests │ ├── app │ ├── assets │ │ └── assets.cpp │ ├── backup_ram │ │ └── backup_ram.cpp │ ├── band_select │ │ ├── band_select.cpp │ │ └── test.mk │ ├── blank │ │ └── blank.cpp │ ├── ble │ │ ├── ibeacon │ │ │ └── application.cpp │ │ ├── prov_mode │ │ │ └── application.cpp │ │ ├── scanner │ │ │ └── application.cpp │ │ ├── uart_central │ │ │ └── application.cpp │ │ └── uart_peripheral │ │ │ └── application.cpp │ ├── button_event │ │ └── button_event.cpp │ ├── cellular_global_identity │ │ └── cellular_global_identity.cpp │ ├── chrono_literals │ │ └── chrono_literals.cpp │ ├── cloud_disconnect │ │ └── cloud_disconnect.cpp │ ├── cloud_event_test │ │ ├── cloud_event_test.cpp │ │ └── event_data.h │ ├── connection-manager │ │ ├── README.md │ │ └── application.cpp │ ├── device_initiated_describe │ │ ├── device_initiated_describe.cpp │ │ └── test.mk │ ├── diagnostics │ │ └── diagnostics.cpp │ ├── echo_server │ │ └── echo_server.cpp │ ├── ethernet │ │ └── ethernet.cpp │ ├── immediate_updates │ │ └── immediate_updates.cpp │ ├── input_pinmode │ │ └── input_pinmode.cpp │ ├── interrupts │ │ └── interrupts.cpp │ ├── ledger_perf │ │ └── ledger_perf.cpp │ ├── ledger_test │ │ ├── README.md │ │ ├── app │ │ │ ├── config.cpp │ │ │ ├── config.h │ │ │ ├── logger.cpp │ │ │ ├── logger.h │ │ │ ├── main.cpp │ │ │ ├── request_handler.cpp │ │ │ └── request_handler.h │ │ ├── build.mk │ │ └── cli │ │ │ ├── errors.js │ │ │ ├── ledger │ │ │ ├── npm-shrinkwrap.json │ │ │ ├── package.json │ │ │ └── util.js │ ├── listen_mode │ │ └── listen_mode.cpp │ ├── listening_mode_delay_issue_1013 │ │ └── listening_mode_delay.cpp │ ├── manual_mode_threading │ │ └── manual_mode_threading.cpp │ ├── mcp23017 │ │ ├── Adafruit_MCP23017.cpp │ │ ├── Adafruit_MCP23017.h │ │ └── application.cpp │ ├── networking │ │ └── networking.cpp │ ├── particle_connect_semi_automatic_issue_1399 │ │ └── test.cpp │ ├── particle_publish_vitals │ │ └── particle_publish_vitals.cpp │ ├── pub_no_ack │ │ └── app.cpp │ ├── rsakeygen │ │ ├── rsakeygen.cpp │ │ └── verify_keys.py │ ├── sleep_multiple_pins │ │ ├── application.cpp │ │ └── gen3.cpp │ ├── stop_mode_power_usage_issue_1098 │ │ └── app.cpp │ ├── tcp_client │ │ └── tcp_client.cpp │ ├── tcp_server │ │ ├── README.md │ │ ├── client │ │ │ ├── client │ │ │ ├── lib │ │ │ │ ├── client.js │ │ │ │ ├── device.js │ │ │ │ ├── test.js │ │ │ │ └── util.js │ │ │ ├── main.js │ │ │ ├── package.json │ │ │ └── tests.js │ │ ├── server.cpp │ │ └── test.mk │ ├── tethering │ │ └── tethering.cpp │ ├── tracker_wakeup │ │ ├── esp32_soch.h │ │ ├── port.cpp │ │ ├── port.h │ │ ├── sdspi_host.cpp │ │ ├── sdspi_host.h │ │ └── tracker_wakeup.cpp │ ├── usb_ctrl_request │ │ ├── README.md │ │ ├── app │ │ │ └── app.cpp │ │ └── test │ │ │ ├── .babelrc │ │ │ ├── package.json │ │ │ └── test │ │ │ ├── support │ │ │ ├── control.js │ │ │ ├── init.js │ │ │ ├── proto.js │ │ │ └── usb.js │ │ │ └── test.js │ └── xmodem_sender │ │ └── xmodem_sender.cpp │ ├── hal │ ├── adc │ │ └── test_adc.cpp │ ├── ble │ │ ├── auxiliary_peripheral │ │ │ └── auxiliary_peripheral.cpp │ │ └── multi_roles │ │ │ ├── application.cpp │ │ │ └── multi_roles.cpp │ ├── cellular │ │ ├── application.cpp │ │ └── test_cellular_command.cpp │ ├── gpio │ │ └── test_gpio.cpp │ ├── interrupts │ │ └── test_interrupts.cpp │ ├── pwm │ │ └── test_pwm.cpp │ ├── rtc │ │ └── test_rtc.cpp │ ├── spi │ │ └── test_spi.cpp │ ├── uart │ │ └── test_uart.cpp │ └── usb_cdc │ │ └── test_usb_cdc.cpp │ ├── integration │ ├── .gitignore │ ├── application │ │ ├── include │ │ │ ├── request_handler.h │ │ │ ├── test.h │ │ │ └── test_suite.h │ │ └── src │ │ │ ├── application.cpp │ │ │ ├── request_handler.cpp │ │ │ └── test_suite.cpp │ ├── communication │ │ ├── events │ │ │ ├── events.cpp │ │ │ └── events.spec.js │ │ ├── events_new │ │ │ ├── events_new.cpp │ │ │ └── events_new.spec.js │ │ ├── functions │ │ │ ├── functions.cpp │ │ │ └── functions.spec.js │ │ ├── ledger │ │ │ ├── ledger.cpp │ │ │ └── ledger.spec.js │ │ ├── long_publish │ │ │ ├── long_publish.cpp │ │ │ └── long_publish.spec.js │ │ └── variables │ │ │ ├── variables.cpp │ │ │ └── variables.spec.js │ ├── ota │ │ ├── assets │ │ │ ├── assets.cpp │ │ │ └── assets.spec.js │ │ ├── factory_reset │ │ │ ├── factory_reset.cpp │ │ │ └── factory_reset.spec.js │ │ ├── min_max_app_size │ │ │ ├── min_max_app_size.cpp │ │ │ ├── min_max_app_size.spec.js │ │ │ └── test.mk │ │ └── multiple_ota_no_reset │ │ │ ├── multiple_ota_no_reset.cpp │ │ │ └── multiple_ota_no_reset.spec.js │ ├── package-lock.json │ ├── package.json │ ├── runner │ │ └── mailbox │ │ │ ├── mailbox.cpp │ │ │ └── mailbox.spec.js │ ├── slo │ │ ├── application_max_size │ │ │ ├── application_max_size.cpp │ │ │ └── application_max_size.spec.js │ │ ├── connect_time │ │ │ ├── connect_time.cpp │ │ │ ├── connect_time.spec.js │ │ │ └── test.mk │ │ └── startup │ │ │ ├── README.md │ │ │ ├── startup-slos.cpp │ │ │ └── startup-slos.spec.js │ ├── test.mk │ └── wiring │ │ ├── acm │ │ ├── ble_central_peripheral │ │ ├── ble_scanner_broadcaster │ │ ├── filesystem │ │ ├── gen3_invalid_compat_user_app │ │ ├── i2c_master_slave │ │ ├── i2c_mcp23017 │ │ ├── ledger │ │ ├── network_config │ │ ├── no_fixture │ │ ├── no_fixture_ble │ │ ├── no_fixture_cellular │ │ ├── no_fixture_i2c │ │ ├── no_fixture_long_running │ │ ├── no_fixture_power_saving │ │ ├── no_fixture_spi │ │ ├── no_fixture_stress │ │ ├── no_fixture_wifi │ │ ├── serial_loopback │ │ ├── serial_loopback2 │ │ ├── sleep20 │ │ ├── spi_master_slave │ │ ├── strformat │ │ ├── time_compat │ │ └── watchdog │ ├── libraries │ └── unit-test │ │ ├── FakeStream.cpp │ │ ├── FakeStream.h │ │ ├── FakeStreamBuffer.cpp │ │ ├── FakeStreamBuffer.h │ │ ├── ParticleFunbag.cpp │ │ ├── flashee-eeprom-impl.h │ │ ├── flashee-eeprom.cpp │ │ ├── flashee-eeprom.h │ │ ├── unit-test.cpp │ │ └── unit-test.h │ ├── readme.md │ ├── reflection │ ├── makefile │ └── readme.md │ ├── tests.mk │ └── wiring │ ├── acm │ ├── acm.config.js │ ├── acm.cpp │ ├── acm.spec.js │ ├── application.cpp │ └── test.mk │ ├── adc_dac │ ├── adc_dac.cpp │ ├── application.cpp │ └── readme.md │ ├── api │ ├── adc.cpp │ ├── application.cpp │ ├── arduino.cpp │ ├── ble.cpp │ ├── cellular.cpp │ ├── cloud.cpp │ ├── crt.cpp │ ├── eeprom.cpp │ ├── ethernet.cpp │ ├── fastpin.cpp │ ├── i2c.cpp │ ├── led.cpp │ ├── network.cpp │ ├── peripherals.cpp │ ├── platform.cpp │ ├── pwm.cpp │ ├── rtc.cpp │ ├── spi.cpp │ ├── string.cpp │ ├── system.cpp │ ├── testapi.h │ ├── thread.cpp │ ├── time.cpp │ ├── timedelay.cpp │ ├── usart.cpp │ ├── watchdog.cpp │ ├── wifi.cpp │ └── wiring.cpp │ ├── ble_central_peripheral │ ├── ble_central │ │ ├── application.cpp │ │ ├── central.cpp │ │ └── util.h │ ├── ble_central_peripheral.config.js │ ├── ble_central_peripheral.spec.js │ └── ble_peripheral │ │ ├── application.cpp │ │ ├── peripheral.cpp │ │ └── util.h │ ├── ble_common │ └── util.h │ ├── ble_scanner_broadcaster │ ├── ble_broadcaster │ │ ├── application.cpp │ │ ├── broadcaster.cpp │ │ └── util.h │ ├── ble_scanner │ │ ├── application.cpp │ │ ├── scanner.cpp │ │ └── util.h │ ├── ble_scanner_broadcaster.config.js │ └── ble_scanner_broadcaster.spec.js │ ├── cellular_no_antenna │ ├── application.cpp │ ├── cellular_no_antenna.cpp │ └── test.mk │ ├── cloud │ ├── application.cpp │ └── cloud.cpp │ ├── filesystem │ ├── application.cpp │ ├── filesystem.spec.js │ ├── posix.cpp │ └── test.mk │ ├── gen3_invalid_compat_user_app │ ├── application.cpp │ ├── gen3_invalid_compat_user_app.spec.js │ └── test.cpp │ ├── i2c_master_slave │ ├── common │ │ └── common.inc │ ├── i2c_master │ │ ├── application.cpp │ │ ├── i2c_master.cpp │ │ └── test.mk │ ├── i2c_master_slave.config.js │ ├── i2c_master_slave.spec.js │ └── i2c_slave │ │ ├── application.cpp │ │ ├── i2c_slave.cpp │ │ └── test.mk │ ├── i2c_master_slave_old │ ├── application.cpp │ └── i2c_master_slave.cpp │ ├── i2c_mcp23017 │ ├── application.cpp │ ├── i2c_helper.cpp │ ├── i2c_helper.h │ ├── i2c_mcp23017.config.js │ ├── i2c_mcp23017.spec.js │ ├── interferer.cpp │ ├── interferer.h │ ├── mcp23017.cpp │ └── test.mk │ ├── ledger │ ├── application.cpp │ ├── ledger.cpp │ ├── ledger.spec.js │ └── test.mk │ ├── network_config │ ├── application.cpp │ ├── network_config.cpp │ ├── network_config.spec.js │ └── test.mk │ ├── networking │ ├── application.cpp │ └── udp_ntp_client.cpp │ ├── nfc │ └── application.cpp │ ├── no_fixture │ ├── application.cpp │ ├── ble_provisioning.cpp │ ├── can.cpp │ ├── cloud.cpp │ ├── concurrent.cpp │ ├── eeprom.cpp │ ├── fastpin.cpp │ ├── gpio.cpp │ ├── i2c.cpp │ ├── interrupts.cpp │ ├── json.cpp │ ├── led.cpp │ ├── logging.cpp │ ├── misc.cpp │ ├── network.cpp │ ├── no_fixture.spec.js │ ├── random.cpp │ ├── readme.md │ ├── simple_ntp_client.cpp │ ├── string.cpp │ ├── system.cpp │ ├── tcp.cpp │ ├── test.include │ ├── test.mk │ ├── thread.cpp │ ├── time.cpp │ ├── timer.cpp │ ├── uart.cpp │ └── wire.cpp │ ├── no_fixture_ble │ ├── application.cpp │ ├── ble.cpp │ ├── no_fixture_ble.spec.js │ └── test.mk │ ├── no_fixture_cellular │ ├── application.cpp │ ├── cellular.cpp │ ├── cloud.cpp │ ├── no_fixture_cellular.spec.js │ └── test.mk │ ├── no_fixture_i2c │ ├── application.cpp │ ├── i2c.cpp │ ├── no_fixture_i2c.spec.js │ └── test.mk │ ├── no_fixture_long_running │ ├── application.cpp │ ├── cellular.cpp │ ├── delay.cpp │ ├── network.cpp │ ├── no_fixture_long_running.spec.js │ ├── pwm.cpp │ ├── servo.cpp │ ├── test.mk │ ├── ticks.cpp │ ├── time.cpp │ └── tone.cpp │ ├── no_fixture_power_saving │ ├── application.cpp │ ├── no_fixture_power_saving.spec.js │ └── power_saving_mode.cpp │ ├── no_fixture_spi │ ├── application.cpp │ ├── no_fixture_spi.spec.js │ ├── spi.cpp │ ├── spix.cpp │ └── test.mk │ ├── no_fixture_stress │ ├── application.cpp │ ├── exflash.cpp │ ├── memory.cpp │ ├── no_fixture_stress.spec.js │ └── test.mk │ ├── no_fixture_wifi │ ├── application.cpp │ ├── no_fixture_wifi.spec.js │ ├── test.mk │ └── wifi.cpp │ ├── persistence │ ├── application.cpp │ ├── diagnostics.cpp │ └── test.mk │ ├── power_management │ └── power.cpp │ ├── power_management_long_running │ └── power.cpp │ ├── pwm │ ├── application.cpp │ ├── pwm.cpp │ └── test.mk │ ├── serial_halfduplex │ ├── application.cpp │ └── serial.cpp │ ├── serial_loopback │ ├── application.cpp │ ├── readme.md │ ├── serial.cpp │ ├── serial_loopback.config.js │ ├── serial_loopback.spec.js │ └── test.mk │ ├── serial_loopback2 │ ├── README.md │ ├── application.cpp │ ├── loopback.cpp │ ├── serial_loopback2.config.js │ ├── serial_loopback2.spec.js │ └── test.mk │ ├── shared_interrupt │ ├── application.cpp │ ├── shared_interrupt.cpp │ └── test.mk │ ├── sleep │ ├── application.cpp │ └── sleep.cpp │ ├── sleep20 │ ├── sleep20.config.js │ ├── sleep20.spec.js │ ├── sleep20_device │ │ ├── application.cpp │ │ ├── sleep20_device.cpp │ │ ├── test.mk │ │ └── util.h │ └── sleep20_tester │ │ ├── application.cpp │ │ ├── sleep20_tester.cpp │ │ ├── test.mk │ │ └── util.h │ ├── spi1_stress │ ├── application.cpp │ ├── esp32_soc.h │ ├── port.cpp │ ├── port.h │ ├── sdspi_host.c │ └── sdspi_host.h │ ├── spi_master_slave │ ├── spi1_master │ │ ├── application.cpp │ │ ├── spi_master_common.cpp │ │ └── test.mk │ ├── spi1_slave │ │ ├── application.cpp │ │ ├── spi_slave_common.cpp │ │ └── test.mk │ ├── spi_master │ │ ├── application.cpp │ │ ├── spi_master_common.cpp │ │ └── test.mk │ ├── spi_master_ethernet_concurrency │ │ ├── application.cpp │ │ ├── spi_master.cpp │ │ └── test.mk │ ├── spi_master_slave.config.js │ ├── spi_master_slave.spec.bak2 │ ├── spi_master_slave.spec.js │ └── spi_slave │ │ ├── application.cpp │ │ ├── spi_slave_common.cpp │ │ └── test.mk │ ├── spi_master_slave_alt │ ├── spi_master │ │ ├── application.cpp │ │ ├── spi_master.cpp │ │ └── test.mk │ └── spi_slave │ │ ├── application.cpp │ │ ├── spi_slave.cpp │ │ └── test.mk │ ├── spi_shield │ ├── application.cpp │ └── spi_fram.cpp │ ├── strformat │ ├── application.cpp │ ├── printf_scanf.cpp │ ├── strformat.spec.js │ └── test.mk │ ├── system │ ├── application.cpp │ └── constructor.cpp │ ├── threading │ ├── application.cpp │ └── listening.cpp │ ├── threading_no_threading_delay │ ├── application.cpp │ └── threading.cpp │ ├── time_compat │ ├── application.cpp │ ├── test.mk │ ├── time_compat.cpp │ └── time_compat.spec.js │ ├── timer_stress │ ├── README.md │ ├── application.cpp │ ├── simple_ntp_client.cpp │ ├── test.mk │ └── ticks.cpp │ ├── usbhid │ ├── application.cpp │ └── usbhid.cpp │ ├── usbhid2 │ ├── application.cpp │ ├── usbhid.cpp │ └── usbhid.py │ ├── usbserial │ ├── application.cpp │ └── usbserial.cpp │ ├── watchdog │ ├── application.cpp │ ├── test.mk │ ├── watchdog.cpp │ └── watchdog.spec.js │ ├── wifi │ ├── application.cpp │ └── wlan.cpp │ └── wifi_cred_check │ ├── application.cpp │ └── wifi_cred_check.cpp ├── wiring ├── .gitignore ├── import.mk ├── inc │ ├── avr │ │ └── pgmspace.h │ ├── debug_output_handler.h │ ├── fast_pin.h │ ├── include.mk │ ├── rtt_output_stream.h │ ├── spark_wiring.h │ ├── spark_wiring_arduino.h │ ├── spark_wiring_arduino_binary.h │ ├── spark_wiring_arduino_constants.h │ ├── spark_wiring_asset.h │ ├── spark_wiring_async.h │ ├── spark_wiring_ble.h │ ├── spark_wiring_buffer.h │ ├── spark_wiring_can.h │ ├── spark_wiring_cellular.h │ ├── spark_wiring_cellular_printable.h │ ├── spark_wiring_character.h │ ├── spark_wiring_client.h │ ├── spark_wiring_cloud.h │ ├── spark_wiring_cloud_event.h │ ├── spark_wiring_constants.h │ ├── spark_wiring_diagnostics.h │ ├── spark_wiring_eeprom.h │ ├── spark_wiring_error.h │ ├── spark_wiring_ethernet.h │ ├── spark_wiring_fixed_point.h │ ├── spark_wiring_flags.h │ ├── spark_wiring_fuel.h │ ├── spark_wiring_global.h │ ├── spark_wiring_i2c.h │ ├── spark_wiring_interrupts.h │ ├── spark_wiring_ipaddress.h │ ├── spark_wiring_json.h │ ├── spark_wiring_led.h │ ├── spark_wiring_ledger.h │ ├── spark_wiring_logging.h │ ├── spark_wiring_map.h │ ├── spark_wiring_network.h │ ├── spark_wiring_nfc.h │ ├── spark_wiring_platform.h │ ├── spark_wiring_posix_common.h │ ├── spark_wiring_power.h │ ├── spark_wiring_print.h │ ├── spark_wiring_printable.h │ ├── spark_wiring_random.h │ ├── spark_wiring_rgb.h │ ├── spark_wiring_servo.h │ ├── spark_wiring_signal.h │ ├── spark_wiring_spi.h │ ├── spark_wiring_spi_proxy.h │ ├── spark_wiring_startup.h │ ├── spark_wiring_stream.h │ ├── spark_wiring_string.h │ ├── spark_wiring_system.h │ ├── spark_wiring_system_power.h │ ├── spark_wiring_tcpclient.h │ ├── spark_wiring_tcpserver.h │ ├── spark_wiring_tether.h │ ├── spark_wiring_thread.h │ ├── spark_wiring_ticks.h │ ├── spark_wiring_time.h │ ├── spark_wiring_timer.h │ ├── spark_wiring_tone.h │ ├── spark_wiring_udp.h │ ├── spark_wiring_usartserial.h │ ├── spark_wiring_usbkeyboard.h │ ├── spark_wiring_usbkeyboard_scancode.h │ ├── spark_wiring_usbmouse.h │ ├── spark_wiring_usbserial.h │ ├── spark_wiring_variant.h │ ├── spark_wiring_vector.h │ ├── spark_wiring_version.h │ ├── spark_wiring_watchdog.h │ ├── spark_wiring_wifi.h │ ├── spark_wiring_wifi_credentials.h │ └── string_convert.h ├── makefile └── src │ ├── build.mk │ ├── rtt_output_stream.cpp │ ├── spark_wiring.cpp │ ├── spark_wiring_asset.cpp │ ├── spark_wiring_async.cpp │ ├── spark_wiring_ble.cpp │ ├── spark_wiring_buffer.cpp │ ├── spark_wiring_can.cpp │ ├── spark_wiring_cellular.cpp │ ├── spark_wiring_cellular_printable.cpp │ ├── spark_wiring_cloud.cpp │ ├── spark_wiring_cloud_event.cpp │ ├── spark_wiring_eeprom.cpp │ ├── spark_wiring_ethernet.cpp │ ├── spark_wiring_fuel.cpp │ ├── spark_wiring_i2c.cpp │ ├── spark_wiring_interrupts.cpp │ ├── spark_wiring_ipaddress.cpp │ ├── spark_wiring_json.cpp │ ├── spark_wiring_led.cpp │ ├── spark_wiring_ledger.cpp │ ├── spark_wiring_logging.cpp │ ├── spark_wiring_network.cpp │ ├── spark_wiring_nfc.cpp │ ├── spark_wiring_power.cpp │ ├── spark_wiring_print.cpp │ ├── spark_wiring_random.cpp │ ├── spark_wiring_rgb.cpp │ ├── spark_wiring_servo.cpp │ ├── spark_wiring_spi.cpp │ ├── spark_wiring_stream.cpp │ ├── spark_wiring_string.cpp │ ├── spark_wiring_system.cpp │ ├── spark_wiring_tcpclient.cpp │ ├── spark_wiring_tcpclient_posix.cpp │ ├── spark_wiring_tcpserver.cpp │ ├── spark_wiring_tcpserver_posix.cpp │ ├── spark_wiring_tether.cpp │ ├── spark_wiring_time.cpp │ ├── spark_wiring_tone.cpp │ ├── spark_wiring_udp.cpp │ ├── spark_wiring_udp_posix.cpp │ ├── spark_wiring_usartserial.cpp │ ├── spark_wiring_usbkeyboard.cpp │ ├── spark_wiring_usbmouse.cpp │ ├── spark_wiring_usbserial.cpp │ ├── spark_wiring_variant.cpp │ ├── spark_wiring_watchdog.cpp │ ├── spark_wiring_wifi.cpp │ ├── string_convert.cpp │ └── user.cpp └── wiring_globals ├── import.mk ├── makefile └── src ├── build.mk ├── spark_wiring_gpio.cpp ├── spark_wiring_watchdog.cpp ├── wiring_globals_cloud.cpp ├── wiring_globals_eeprom.cpp ├── wiring_globals_i2c.cpp ├── wiring_globals_ipaddress.cpp ├── wiring_globals_spi.cpp └── wiring_globals_usart.cpp /.bundleignore: -------------------------------------------------------------------------------- 1 | **/.git 2 | **/*.zip 3 | /ci 4 | /docs 5 | /misc 6 | /test 7 | /build/target 8 | /third_party/ambd_sdk/ambd_sdk/doc 9 | /third_party/ambd_sdk/ambd_sdk/tools 10 | /third_party/ambd_sdk/ambd_sdk/component/common/example/ 11 | /third_party/nrf5_sdk/nrf5_sdk/examples 12 | /third_party/nrf5_sdk/nrf5_sdk/components/802_15_4 13 | /third_party/nrf5_sdk/nrf5_sdk/components/toolchain/cmsis/dsp 14 | /third_party/freertos/freertos/FreeRTOS/Demo 15 | /third_party/freertos/freertos/FreeRTOS-Plus 16 | /user/applications/tinker/target 17 | 18 | -------------------------------------------------------------------------------- /.workbench/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "toolchains": [ 4 | { 5 | "platforms": [12, 13, 15, 23, 25, 26, 28, 32, 35, 37], 6 | "firmware": "deviceOS@source", 7 | "compilers": "gcc-arm@10.2.1", 8 | "tools": "buildtools@1.1.1", 9 | "scripts": "buildscripts@1.15.0", 10 | "debuggers": "openocd@0.11.0-particle.4" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /bootloader/.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | 4 | # Libraries 5 | *.lib 6 | *.a 7 | 8 | # Shared objects (inc. Windows DLLs) 9 | *.dll 10 | *.so 11 | *.so.* 12 | *.dylib 13 | 14 | # Executables 15 | *.exe 16 | *.out 17 | *.app 18 | 19 | # Debug folder 20 | Debug/* 21 | 22 | # Release folder 23 | Release/* 24 | 25 | # build folder 26 | *.map 27 | *.lst 28 | *.d 29 | *.o 30 | 31 | # Platform-specific settings 32 | .settings/* 33 | .cproject 34 | .project 35 | 36 | # Raisonance RIDE Project 37 | RIDE/* 38 | 39 | # backup folder 40 | backup/* 41 | -------------------------------------------------------------------------------- /bootloader/import.mk: -------------------------------------------------------------------------------- 1 | BOOTLOADER_MODULE_PATH ?= $(PROJECT_ROOT)/bootloader 2 | # Bootloader version is defined along with other modules in system_module_version.mk 3 | # BOOTLOADER_VERSION ?= 12 4 | include $(BOOTLOADER_MODULE_PATH)/../modules/shared/system_module_version.mk 5 | BOOTLOADER_BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM) 6 | 7 | # bring in the include folders from inc and src/ is includes 8 | include $(call rwildcard,$(BOOTLOADER_MODULE_PATH)/inc/,include.mk) 9 | include $(call rwildcard,$(BOOTLOADER_MODULE_PATH)/src/$(PLATFORM_NAME)/,include.mk) 10 | 11 | -------------------------------------------------------------------------------- /bootloader/prebootloader/src/rtl872x/mbr/include.mk: -------------------------------------------------------------------------------- 1 | MAIN_STACK_SIZE = 4096 2 | 3 | ASFLAGS += -D__STACKSIZE__=$(MAIN_STACK_SIZE) -D__STACK_SIZE=$(MAIN_STACK_SIZE) 4 | 5 | LDFLAGS += -L$(COMMON_BUILD)/arm/linker/rtl872x 6 | LDFLAGS += -L$(BOOTLOADER_SHARED_MODULAR) 7 | LDFLAGS += -Wl,--defsym,__STACKSIZE__=$(MAIN_STACK_SIZE) 8 | LDFLAGS += -Wl,--defsym,__STACK_SIZE=$(MAIN_STACK_SIZE) 9 | -------------------------------------------------------------------------------- /bootloader/prebootloader/src/rtl872x/mbr/module_info.c: -------------------------------------------------------------------------------- 1 | #include "module_info.inc" 2 | -------------------------------------------------------------------------------- /bootloader/prebootloader/src/rtl872x/mbr/tlm.mk: -------------------------------------------------------------------------------- 1 | export PLATFORM_MCU_CORE=m23 2 | included_productid_mk := 3 | -------------------------------------------------------------------------------- /bootloader/prebootloader/src/rtl872x/part1/module_info.c: -------------------------------------------------------------------------------- 1 | #include "module_info.inc" 2 | -------------------------------------------------------------------------------- /bootloader/prebootloader/src/rtl872x/part1/tlm.mk: -------------------------------------------------------------------------------- 1 | export PLATFORM_MCU_CORE=m23 2 | included_productid_mk := 3 | -------------------------------------------------------------------------------- /bootloader/prebootloader/src/rtl872x/shared/include.mk: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRS += $(BOOTLOADER_SHARED_MODULAR) 2 | -------------------------------------------------------------------------------- /bootloader/src/argon/include.mk: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRS += $(BOOTLOADER_MODULE_PATH)/src/$(PLATFORM_NAME) 2 | include $(BOOTLOADER_MODULE_PATH)/src/nRF52840/include.mk 3 | -------------------------------------------------------------------------------- /bootloader/src/argon/sources.mk: -------------------------------------------------------------------------------- 1 | BOOTLOADER_SRC_PATH = $(BOOTLOADER_MODULE_PATH)/src/${PLATFORM_NAME} 2 | include $(BOOTLOADER_MODULE_PATH)/src/nRF52840/sources.mk -------------------------------------------------------------------------------- /bootloader/src/b5som/include.mk: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRS += $(BOOTLOADER_MODULE_PATH)/src/$(PLATFORM_NAME) 2 | include $(BOOTLOADER_MODULE_PATH)/src/nRF52840/include.mk 3 | -------------------------------------------------------------------------------- /bootloader/src/b5som/sources.mk: -------------------------------------------------------------------------------- 1 | BOOTLOADER_SRC_PATH = $(BOOTLOADER_MODULE_PATH)/src/${PLATFORM_NAME} 2 | include $(BOOTLOADER_MODULE_PATH)/src/nRF52840/sources.mk -------------------------------------------------------------------------------- /bootloader/src/boron/include.mk: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRS += $(BOOTLOADER_MODULE_PATH)/src/$(PLATFORM_NAME) 2 | include $(BOOTLOADER_MODULE_PATH)/src/nRF52840/include.mk 3 | -------------------------------------------------------------------------------- /bootloader/src/boron/sources.mk: -------------------------------------------------------------------------------- 1 | BOOTLOADER_SRC_PATH = $(BOOTLOADER_MODULE_PATH)/src/${PLATFORM_NAME} 2 | include $(BOOTLOADER_MODULE_PATH)/src/nRF52840/sources.mk -------------------------------------------------------------------------------- /bootloader/src/electron2/include.mk: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRS += $(BOOTLOADER_MODULE_PATH)/src/$(PLATFORM_NAME) 2 | include $(BOOTLOADER_MODULE_PATH)/src/nRF52840/include.mk 3 | -------------------------------------------------------------------------------- /bootloader/src/electron2/sources.mk: -------------------------------------------------------------------------------- 1 | BOOTLOADER_SRC_PATH = $(BOOTLOADER_MODULE_PATH)/src/${PLATFORM_NAME} 2 | include $(BOOTLOADER_MODULE_PATH)/src/nRF52840/sources.mk -------------------------------------------------------------------------------- /bootloader/src/module_info.c: -------------------------------------------------------------------------------- 1 | 2 | #include "module_info.inc" 3 | -------------------------------------------------------------------------------- /bootloader/src/msom/include.mk: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRS += $(BOOTLOADER_MODULE_PATH)/src/$(PLATFORM_NAME) 2 | include $(BOOTLOADER_MODULE_PATH)/src/rtl872x/include.mk 3 | -------------------------------------------------------------------------------- /bootloader/src/msom/sources.mk: -------------------------------------------------------------------------------- 1 | BOOTLOADER_SRC_PATH = $(BOOTLOADER_MODULE_PATH)/src/${PLATFORM_NAME} 2 | include $(BOOTLOADER_MODULE_PATH)/src/rtl872x/sources.mk -------------------------------------------------------------------------------- /bootloader/src/nRF52840/bootloader_dct.h: -------------------------------------------------------------------------------- 1 | #ifndef BOOTLOADER_DCT_H 2 | #define BOOTLOADER_DCT_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | void load_dct_functions(); 9 | 10 | #ifdef __cplusplus 11 | } // extern "C" 12 | #endif 13 | 14 | #endif // BOOTLOADER_DCT_H 15 | -------------------------------------------------------------------------------- /bootloader/src/nRF52840/deviceid_hal.cpp: -------------------------------------------------------------------------------- 1 | // pull in the sources from the HAL. It's a bit of a hack, but is simpler than trying to link the 2 | // full hal library. 3 | #define HAL_DEVICE_ID_NO_DCT 4 | #include "../src/nRF52840/deviceid_hal.cpp" 5 | #include "bytes2hexbuf.h" 6 | -------------------------------------------------------------------------------- /bootloader/src/nRF52840/include.mk: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRS += $(BOOTLOADER_MODULE_PATH)/src/nRF52840 2 | 3 | MAIN_STACK_SIZE = 8192 4 | 5 | ASFLAGS += -D__STACKSIZE__=$(MAIN_STACK_SIZE) -D__STACK_SIZE=$(MAIN_STACK_SIZE) 6 | 7 | LDFLAGS += -L$(COMMON_BUILD)/arm/linker/nrf52840 8 | # __STACKSIZE__ is referenced by build/arm/linker/nrf52840/platform_ram.ld 9 | LDFLAGS += -Wl,--defsym,__STACKSIZE__=$(MAIN_STACK_SIZE) 10 | LDFLAGS += -Wl,--defsym,__STACK_SIZE=$(MAIN_STACK_SIZE) 11 | -------------------------------------------------------------------------------- /bootloader/src/rtl872x/bkpreg_hal.c: -------------------------------------------------------------------------------- 1 | 2 | // pull in the sources from the HAL. It's a bit of a hack, but is simpler than trying to link the 3 | // full hal library. 4 | #include "../src/rtl872x/bkpreg_hal.c" 5 | -------------------------------------------------------------------------------- /bootloader/src/rtl872x/bootloader_dct.h: -------------------------------------------------------------------------------- 1 | #ifndef BOOTLOADER_DCT_H 2 | #define BOOTLOADER_DCT_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | void load_dct_functions(); 9 | 10 | #ifdef __cplusplus 11 | } // extern "C" 12 | #endif 13 | 14 | #endif // BOOTLOADER_DCT_H 15 | -------------------------------------------------------------------------------- /bootloader/src/rtl872x/deviceid_hal.cpp: -------------------------------------------------------------------------------- 1 | // pull in the sources from the HAL. It's a bit of a hack, but is simpler than trying to link the 2 | // full hal library. 3 | #define HAL_DEVICE_ID_NO_DCT 4 | #include "../src/rtl872x/deviceid_hal.cpp" 5 | #include "bytes2hexbuf.h" 6 | -------------------------------------------------------------------------------- /bootloader/src/rtl872x/include.mk: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRS += $(BOOTLOADER_MODULE_PATH)/src/rtl872x 2 | 3 | MAIN_STACK_SIZE = 8192 4 | 5 | ASFLAGS += -D__STACKSIZE__=$(MAIN_STACK_SIZE) -D__STACK_SIZE=$(MAIN_STACK_SIZE) 6 | 7 | LDFLAGS += -L$(COMMON_BUILD)/arm/linker/rtl872x 8 | LDFLAGS += -Wl,--defsym,__STACKSIZE__=$(MAIN_STACK_SIZE) 9 | LDFLAGS += -Wl,--defsym,__STACK_SIZE=$(MAIN_STACK_SIZE) 10 | -------------------------------------------------------------------------------- /bootloader/src/rtl872x/spark_wiring_interrupts.h: -------------------------------------------------------------------------------- 1 | #include "../../../wiring/inc/spark_wiring_interrupts.h" 2 | -------------------------------------------------------------------------------- /bootloader/src/sources.mk: -------------------------------------------------------------------------------- 1 | BOOTLOADER_SRC_COMMON_PATH = $(BOOTLOADER_MODULE_PATH)/src 2 | 3 | CSRC += $(BOOTLOADER_SRC_COMMON_PATH)/main.c 4 | CSRC += $(BOOTLOADER_SRC_COMMON_PATH)/module_info.c 5 | 6 | -------------------------------------------------------------------------------- /bootloader/src/tracker/include.mk: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRS += $(BOOTLOADER_MODULE_PATH)/src/$(PLATFORM_NAME) 2 | include $(BOOTLOADER_MODULE_PATH)/src/nRF52840/include.mk 3 | -------------------------------------------------------------------------------- /bootloader/src/tracker/sources.mk: -------------------------------------------------------------------------------- 1 | BOOTLOADER_SRC_PATH = $(BOOTLOADER_MODULE_PATH)/src/${PLATFORM_NAME} 2 | include $(BOOTLOADER_MODULE_PATH)/src/nRF52840/sources.mk -------------------------------------------------------------------------------- /bootloader/src/trackerm/include.mk: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRS += $(BOOTLOADER_MODULE_PATH)/src/$(PLATFORM_NAME) 2 | include $(BOOTLOADER_MODULE_PATH)/src/rtl872x/include.mk 3 | -------------------------------------------------------------------------------- /bootloader/src/trackerm/sources.mk: -------------------------------------------------------------------------------- 1 | BOOTLOADER_SRC_PATH = $(BOOTLOADER_MODULE_PATH)/src/${PLATFORM_NAME} 2 | include $(BOOTLOADER_MODULE_PATH)/src/rtl872x/sources.mk -------------------------------------------------------------------------------- /bootloader/src/tron/include.mk: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRS += $(BOOTLOADER_MODULE_PATH)/src/$(PLATFORM_NAME) 2 | include $(BOOTLOADER_MODULE_PATH)/src/rtl872x/include.mk 3 | -------------------------------------------------------------------------------- /bootloader/src/tron/sources.mk: -------------------------------------------------------------------------------- 1 | BOOTLOADER_SRC_PATH = $(BOOTLOADER_MODULE_PATH)/src/${PLATFORM_NAME} 2 | include $(BOOTLOADER_MODULE_PATH)/src/rtl872x/sources.mk -------------------------------------------------------------------------------- /build/arm-tlm.mk: -------------------------------------------------------------------------------- 1 | # makefile for ARM top level modules 2 | 3 | mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) 4 | current_dir := $(patsubst %/,%,$(dir $(mkfile_path))) 5 | 6 | include $(current_dir)/top-level-module.mk 7 | 8 | 9 | ifeq ("$(ARCH)","arm") 10 | include $(current_dir)/arm-tools.mk 11 | else 12 | ifeq ("$(ARCH)","gcc") 13 | include $(current_dir)/gcc-tools.mk 14 | else 15 | $(error "Unknown architecture '$(ARCH)'"); 16 | endif 17 | endif 18 | 19 | include $(COMMON_BUILD)/lang-std.mk 20 | 21 | include $(COMMON_BUILD)/module.mk -------------------------------------------------------------------------------- /build/arm/linker/linker_build_id.ld: -------------------------------------------------------------------------------- 1 | .note.gnu.build-id : 2 | { 3 | __start_gnu_build_id_start = .; 4 | link_gnu_build_id_location_start = .; 5 | KEEP(*(.note.gnu.build-id)) 6 | link_gnu_build_id_location_end = .; 7 | } >APP_FLASH AT> APP_FLASH 8 | -------------------------------------------------------------------------------- /build/arm/linker/linker_freertos_task_symbols.ld: -------------------------------------------------------------------------------- 1 | __rtos_capture_start = .; 2 | *tasks.o(.bss COMMON .bss*) 3 | *timers*.o(.bss COMMON .bss*) 4 | __rtos_capture_end = .; 5 | -------------------------------------------------------------------------------- /build/arm/linker/linker_module_info.ld: -------------------------------------------------------------------------------- 1 | .module_info : 2 | { 3 | . = ALIGN(4); 4 | link_module_info_start = .; 5 | KEEP (*.o(.modinfo.module_info)) 6 | link_module_info_end = .; 7 | } > APP_FLASH AT> APP_FLASH 8 | -------------------------------------------------------------------------------- /build/arm/linker/linker_module_info_ext.ld: -------------------------------------------------------------------------------- 1 | .module_info : 2 | { 3 | . = ALIGN(4); 4 | link_module_info_start = .; 5 | KEEP (*.o(.modinfo.module_info)) 6 | link_module_info_end = .; 7 | } > APP_FLASH_EXT AT> APP_FLASH_EXT 8 | -------------------------------------------------------------------------------- /build/arm/linker/linker_module_start.ld: -------------------------------------------------------------------------------- 1 | .module_start : 2 | { 3 | link_module_start = .; 4 | } > APP_FLASH 5 | -------------------------------------------------------------------------------- /build/arm/linker/linker_module_start_ext.ld: -------------------------------------------------------------------------------- 1 | .module_start : 2 | { 3 | link_module_start = .; 4 | } > APP_FLASH_EXT 5 | -------------------------------------------------------------------------------- /build/arm/linker/linker_newhalcpu.ld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot/device-os/99fd93b8965da95c112c6afb4058427109b1ad57/build/arm/linker/linker_newhalcpu.ld -------------------------------------------------------------------------------- /build/arm/linker/linker_static_ram_end.ld: -------------------------------------------------------------------------------- 1 | .static_ram_end : 2 | { 3 | link_static_ram_end = .; 4 | } > SRAM 5 | -------------------------------------------------------------------------------- /build/arm/linker/linker_static_ram_start.ld: -------------------------------------------------------------------------------- 1 | .static_ram_start : 2 | { 3 | link_static_ram_start = .; 4 | } > SRAM 5 | -------------------------------------------------------------------------------- /build/arm/linker/nrf52840/linker_backup_ram_user.ld: -------------------------------------------------------------------------------- 1 | .backup : 2 | { 3 | link_global_retained_initial_values = LOADADDR( .backup ); /* This is the location in flash of the initial values of retained global variables */ 4 | link_global_retained_start = .; 5 | *(.retained_user*) 6 | link_global_retained_end = .; 7 | . = ALIGN(., 4); 8 | } > BACKUPSRAM_USER AT> APP_FLASH 9 | -------------------------------------------------------------------------------- /build/arm/linker/rtl872x/linker_backup_ram_user.ld: -------------------------------------------------------------------------------- 1 | .backup : 2 | { 3 | link_global_retained_initial_values = LOADADDR( .backup ); /* This is the location in flash of the initial values of retained global variables */ 4 | link_global_retained_start = .; 5 | *(.retained_user*) 6 | link_global_retained_end = .; 7 | . = ALIGN(., 4); 8 | } > BACKUPSRAM_USER AT> APP_FLASH 9 | -------------------------------------------------------------------------------- /build/arm/linker/rtl872x/platform_ram_shared.ld: -------------------------------------------------------------------------------- 1 | /* FIXME: duplicates platform_ram_size in platform_ram.ld */ 2 | platform_km4_ram_size = 476K; 3 | platform_km4_ram_start = 0x10005000; 4 | platform_km4_ram_end = platform_km4_ram_start + platform_km4_ram_size; 5 | 6 | platform_km4_ram_reserved = 4K; 7 | 8 | platform_km0_part1_wifi_fw_ram_start = platform_km4_ram_start + platform_km4_ram_reserved; 9 | platform_km0_part1_wifi_fw_ram_size = 80K; 10 | platform_km0_part1_wifi_fw_ram_end = platform_km0_part1_wifi_fw_ram_start + platform_km0_part1_wifi_fw_ram_size; 11 | -------------------------------------------------------------------------------- /build/arm/startup/spark_init.S: -------------------------------------------------------------------------------- 1 | .ifdef SPARK_INIT_STARTUP 2 | /* Call the hal core configuration function. */ 3 | bl HAL_Core_Config 4 | .endif 5 | /* Call C++ constructors. */ 6 | bl CallConstructors 7 | 8 | -------------------------------------------------------------------------------- /build/arm/startup/startup_newhalcpu.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot/device-os/99fd93b8965da95c112c6afb4058427109b1ad57/build/arm/startup/startup_newhalcpu.S -------------------------------------------------------------------------------- /build/bin/win32/sha256sum.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot/device-os/99fd93b8965da95c112c6afb4058427109b1ad57/build/bin/win32/sha256sum.exe -------------------------------------------------------------------------------- /build/checks.mk: -------------------------------------------------------------------------------- 1 | # Add environment checks here 2 | 3 | #ifeq (,$(shell command -v git;)) 4 | # $(error Git is not installed) 5 | #endif 6 | -------------------------------------------------------------------------------- /build/lang-std.mk: -------------------------------------------------------------------------------- 1 | # Set C++ version to C++17 globally and set C version to C11 2 | CPPFLAGS += -std=gnu++17 3 | CONLYFLAGS += -std=gnu11 4 | 5 | # NOTE: Keep this in sync with test/unit_tests/CMakeLists.txt 6 | -------------------------------------------------------------------------------- /build/os.mk: -------------------------------------------------------------------------------- 1 | 2 | # define a symbol MAKE_OS for the current operating system 3 | # WINSOWS | LINUX | OSX 4 | 5 | ifeq ($(OS),Windows_NT) 6 | MAKE_OS = WINDOWS 7 | ifeq ($(PROCESSOR_ARCHITECTURE),AMD64) 8 | CPU=AMD64 9 | endif 10 | ifeq ($(PROCESSOR_ARCHITECTURE),x86) 11 | CPU=IA32 12 | endif 13 | else 14 | UNAME_S := $(shell uname -s) 15 | ifeq ($(UNAME_S),Linux) 16 | MAKE_OS=LINUX 17 | endif 18 | ifeq ($(UNAME_S),Darwin) 19 | MAKE_OS=OSX 20 | endif 21 | endif 22 | -------------------------------------------------------------------------------- /build/serial_switcher.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import serial 4 | import sys 5 | 6 | baudRate = 14400 7 | neutralBaudRate = 9600 8 | portName = "/dev/ttyACM0" 9 | 10 | if len(sys.argv) > 1: 11 | baudRate = int(sys.argv[1]) 12 | 13 | if len(sys.argv) > 2: 14 | portName = sys.argv[2] 15 | 16 | ser = serial.Serial(portName, baudRate) 17 | ser.close() 18 | 19 | ser = serial.Serial(portName, neutralBaudRate) 20 | ser.close() 21 | 22 | 23 | -------------------------------------------------------------------------------- /build/test/build.bats: -------------------------------------------------------------------------------- 1 | load build 2 | 3 | @test "make is version 3.81" { 4 | run make --version 5 | [ "${lines[0]}" == 'GNU Make 3.81' ] 6 | } 7 | -------------------------------------------------------------------------------- /build/test/files/applibs spaces/app1/app.cpp: -------------------------------------------------------------------------------- 1 | #include "Particle.h" 2 | 3 | #include "lib1.h" 4 | #include "lib2.h" 5 | 6 | 7 | 8 | void setup() 9 | { 10 | lib1(); 11 | lib2("hello"); 12 | } 13 | -------------------------------------------------------------------------------- /build/test/files/applibs spaces/lib1/lib1.cpp: -------------------------------------------------------------------------------- 1 | #include "lib1.h" 2 | #include "Particle.h" 3 | void lib1() 4 | { 5 | Serial.println("hello from lib1"); 6 | } 7 | -------------------------------------------------------------------------------- /build/test/files/applibs spaces/lib1/lib1.h: -------------------------------------------------------------------------------- 1 | 2 | void lib1(); 3 | -------------------------------------------------------------------------------- /build/test/files/applibs spaces/lib2/lib2.cpp: -------------------------------------------------------------------------------- 1 | #include "lib2.h" 2 | #include "Particle.h" 3 | 4 | void lib2(const char* msg) { 5 | Serial.println(msg); 6 | } 7 | -------------------------------------------------------------------------------- /build/test/files/applibs spaces/lib2/lib2.h: -------------------------------------------------------------------------------- 1 | void lib2(const char* msg); 2 | -------------------------------------------------------------------------------- /build/test/files/applibs/app/app.cpp: -------------------------------------------------------------------------------- 1 | #include "Particle.h" 2 | 3 | #include "lib1.h" 4 | #include "lib2.h" 5 | 6 | 7 | 8 | void setup() 9 | { 10 | lib1(); 11 | lib2("hello"); 12 | } 13 | -------------------------------------------------------------------------------- /build/test/files/applibs/lib1/lib.cpp: -------------------------------------------------------------------------------- 1 | #include "lib1.h" 2 | #include "Particle.h" 3 | void lib1() 4 | { 5 | Serial.println("hello from lib1"); 6 | } 7 | -------------------------------------------------------------------------------- /build/test/files/applibs/lib1/lib1.h: -------------------------------------------------------------------------------- 1 | #include "lib1internal/lib1.h" 2 | -------------------------------------------------------------------------------- /build/test/files/applibs/lib1/lib1internal/lib1.h: -------------------------------------------------------------------------------- 1 | 2 | void lib1(); 3 | -------------------------------------------------------------------------------- /build/test/files/applibs/lib2/lib.cpp: -------------------------------------------------------------------------------- 1 | #include "lib2.h" 2 | #include "Particle.h" 3 | 4 | void lib2(const char* msg) { 5 | Serial.println(msg); 6 | } 7 | -------------------------------------------------------------------------------- /build/test/files/applibs/lib2/lib2.h: -------------------------------------------------------------------------------- 1 | void lib2(const char* msg); 2 | -------------------------------------------------------------------------------- /build/test/files/applibs/readme.txt: -------------------------------------------------------------------------------- 1 | - each library deliberately includes the same named .cpp file to verify that the build keeps the objects from 2 | each library separate 3 | - each library includes private headers that are qualified with the name of the library 4 | -------------------------------------------------------------------------------- /build/test/files/applibs_v2/app/app.cpp: -------------------------------------------------------------------------------- 1 | #include "Particle.h" 2 | 3 | #include "lib1.h" 4 | #include "lib2.h" 5 | 6 | 7 | 8 | void setup() 9 | { 10 | lib1(); 11 | lib2("hello"); 12 | } 13 | -------------------------------------------------------------------------------- /build/test/files/applibs_v2/lib1/src/lib.cpp: -------------------------------------------------------------------------------- 1 | #include "lib1.h" 2 | #include "Particle.h" 3 | void lib1() 4 | { 5 | Serial.println("hello from lib1"); 6 | } 7 | -------------------------------------------------------------------------------- /build/test/files/applibs_v2/lib1/src/lib1.h: -------------------------------------------------------------------------------- 1 | 2 | void lib1(); 3 | -------------------------------------------------------------------------------- /build/test/files/applibs_v2/lib2/examples/example1.cpp: -------------------------------------------------------------------------------- 1 | #error do not compile me I'm just an example. 2 | -------------------------------------------------------------------------------- /build/test/files/applibs_v2/lib2/src/lib.cpp: -------------------------------------------------------------------------------- 1 | #include "lib2.h" 2 | #include "Particle.h" 3 | 4 | void lib2(const char* msg) { 5 | Serial.println(msg); 6 | } 7 | -------------------------------------------------------------------------------- /build/test/files/applibs_v2/lib2/src/lib2.h: -------------------------------------------------------------------------------- 1 | void lib2(const char* msg); 2 | -------------------------------------------------------------------------------- /build/test/files/applibs_v2_vendored/app/lib/lib1/src/lib.cpp: -------------------------------------------------------------------------------- 1 | #include "lib1.h" 2 | #include "Particle.h" 3 | void lib1() 4 | { 5 | Serial.println("hello from lib1"); 6 | } 7 | -------------------------------------------------------------------------------- /build/test/files/applibs_v2_vendored/app/lib/lib1/src/lib1.h: -------------------------------------------------------------------------------- 1 | 2 | void lib1(); 3 | -------------------------------------------------------------------------------- /build/test/files/applibs_v2_vendored/app/lib/lib2/examples/example1.cpp: -------------------------------------------------------------------------------- 1 | #error do not compile me I'm just an example. 2 | -------------------------------------------------------------------------------- /build/test/files/applibs_v2_vendored/app/lib/lib2/src/lib.cpp: -------------------------------------------------------------------------------- 1 | #include "lib2.h" 2 | #include "Particle.h" 3 | 4 | void lib2(const char* msg) { 5 | Serial.println(msg); 6 | } 7 | -------------------------------------------------------------------------------- /build/test/files/applibs_v2_vendored/app/lib/lib2/src/lib2.h: -------------------------------------------------------------------------------- 1 | void lib2(const char* msg); 2 | -------------------------------------------------------------------------------- /build/test/files/applibs_v2_vendored/app/src/app.cpp: -------------------------------------------------------------------------------- 1 | #include "Particle.h" 2 | 3 | #include "lib1.h" 4 | #include "lib2.h" 5 | 6 | 7 | 8 | void setup() 9 | { 10 | lib1(); 11 | lib2("hello"); 12 | } 13 | -------------------------------------------------------------------------------- /build/test/files/applibs_v2_vendored/app_explicit/src/app.cpp: -------------------------------------------------------------------------------- 1 | #include "Particle.h" 2 | 3 | #include "lib1.h" 4 | #include "lib2.h" 5 | 6 | 7 | 8 | void setup() 9 | { 10 | lib1(); 11 | lib2("hello"); 12 | } 13 | -------------------------------------------------------------------------------- /build/test/readme.md: -------------------------------------------------------------------------------- 1 | # Integration Tests for the makefile build 2 | 3 | ## Setup 4 | 5 | Install BATS 6 | 7 | ``` 8 | brew install bats 9 | ``` 10 | 11 | ## Running 12 | 13 | ``` 14 | cd build/test 15 | ./runall.bash 16 | ``` 17 | 18 | That's it. :-) 19 | 20 | 21 | -------------------------------------------------------------------------------- /build/test/runall.bash: -------------------------------------------------------------------------------- 1 | function die 2 | { 3 | exit 1 4 | } 5 | 6 | bats build.bats || die 7 | bats boron.bats || die 8 | bats libs.bats || die 9 | -------------------------------------------------------------------------------- /build/top-level-module.mk: -------------------------------------------------------------------------------- 1 | # Makefile for building modules 2 | 3 | # assume project is at top level directory if PROJECT_ROOT not specified 4 | PROJECT_ROOT ?= .. 5 | MODULE_PATH=. 6 | COMMON_BUILD=$(PROJECT_ROOT)/build 7 | BUILD_PATH_BASE?=$(COMMON_BUILD)/target 8 | 9 | 10 | include $(COMMON_BUILD)/platform-id.mk 11 | include $(COMMON_BUILD)/checks.mk 12 | -------------------------------------------------------------------------------- /build/verbose.mk: -------------------------------------------------------------------------------- 1 | # Macros for controlling verbosity 2 | # definition of verbose variable 'v' used to enable verbose output 3 | # $(VERBOSE) expands to empty or @ to suppress echoing commands in recipes 4 | # $(call,echo,text) conditionally outputs text if verbose is enabled 5 | 6 | ifeq ("$(subst s,,$(MAKEFLAGS))","$(MAKEFLAGS)") 7 | v=1 8 | else 9 | v=0 10 | endif 11 | 12 | ifeq ("$(v)","1") 13 | ECHO=echo 14 | VERBOSE= 15 | VERBOSE_REDIRECT= 16 | else 17 | ECHO = true 18 | VERBOSE=@ 19 | VERBOSE_REDIRECT= > /dev/null 2>&1 20 | endif 21 | 22 | echo=@$(ECHO) $1 23 | -------------------------------------------------------------------------------- /build/version.mk: -------------------------------------------------------------------------------- 1 | VERSION_STRING = 6.3.2 2 | 3 | # PRODUCT_FIRMWARE_VERSION reported by default 4 | # FIXME: Unclear if this is used, PRODUCT_FIRMWARE_VERSION defaults to 65535 every release 5 | VERSION = 6303 6 | 7 | CFLAGS += -DSYSTEM_VERSION_STRING=$(VERSION_STRING) 8 | -------------------------------------------------------------------------------- /ci/build_boost.sh: -------------------------------------------------------------------------------- 1 | toolset="gcc" 2 | if [[ $OSTYPE == darwin* ]]; then 3 | toolset="darwin" 4 | fi 5 | 6 | pushd $BOOST_ROOT 7 | ./bootstrap.sh 8 | ./b2 --with-iostreams --with-thread --with-system --with-program_options --with-random --with-regex --with-json --threading=multi toolset=$toolset 9 | popd 10 | -------------------------------------------------------------------------------- /ci/install_arm_gcc.sh: -------------------------------------------------------------------------------- 1 | # NOTE: you probably want to 2 | # specify a version like this: - sudo apt-get install -qq "gcc-arm-none-eabi=4.8.2-14ubuntu1+6" 3 | 4 | sudo add-apt-repository -y ppa:terry.guo/gcc-arm-embedded && 5 | sudo apt-get -qq update && 6 | sudo apt-get -qq install "gcc-arm-none-eabi" && 7 | arm-none-eabi-gcc --version ; 8 | -------------------------------------------------------------------------------- /ci/install_gcc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Install gcc-4.8 as the default gcc 4 | 5 | sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && 6 | sudo apt-get -qq update && 7 | sudo apt-get -qq install gcc-4.8 g++-4.8 && 8 | sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20 && 9 | sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20 && 10 | gcc --version 11 | -------------------------------------------------------------------------------- /communication-dynalib/import.mk: -------------------------------------------------------------------------------- 1 | COMMUNICATION_DYNALIB_MODULE_NAME = communication-dynalib 2 | COMMUNICATION_DYNALIB_MODULE_PATH ?= $(PROJECT_ROOT)/$(COMMUNICATION_DYNALIB_MODULE_NAME) 3 | include $(call rwildcard,$(COMMUNICATION_DYNALIB_MODULE_PATH)/,include.mk) 4 | 5 | COMMUNICATION_DYNALIB_BUILD_PATH_EXT=$(BUILD_TARGET_PLATFORM) 6 | COMMUNICATION_DYNALIB_LIB_DIR = $(BUILD_PATH_BASE)/$(COMMUNICATION_DYNALIB_MODULE_NAME)/$(COMMUNICATION_DYNALIB_BUILD_PATH_EXT) 7 | COMMUNICATION_DYNALIB_LIB_DEP = $(COMMUNICATION_DYNALIB_LIB_DIR)/lib$(COMMUNICATION_DYNALIB_MODULE_NAME).a 8 | 9 | -------------------------------------------------------------------------------- /communication-dynalib/makefile: -------------------------------------------------------------------------------- 1 | 2 | MODULE=communication-dynalib 3 | COMMUNICATION_DYNALIB_MODULE_PATH=. 4 | 5 | # Target this makefile is building. 6 | TARGET_TYPE = a 7 | BUILD_PATH_EXT=$(COMMUNICATION_DYNALIB_BUILD_PATH_EXT) 8 | 9 | DEPENDENCIES = communication dynalib hal 10 | 11 | include ../build/arm-tlm.mk 12 | -------------------------------------------------------------------------------- /communication-dynalib/src/build.mk: -------------------------------------------------------------------------------- 1 | TARGET_COMMUNICATION_DYNALIB_SRC_PATH = $(COMMUNICATION_DYNALIB_MODULE_PATH)/src 2 | 3 | CPPSRC += $(call target_files,$(TARGET_COMMUNICATION_DYNALIB_SRC_PATH),*.cpp) 4 | CSRC += $(call target_files,$(TARGET_COMMUNICATION_DYNALIB_SRC_PATH),*.c) 5 | -------------------------------------------------------------------------------- /communication-dynalib/src/communication_dynalib.c: -------------------------------------------------------------------------------- 1 | 2 | #define DYNALIB_IMPORT 3 | #include "communication_dynalib.h" 4 | 5 | -------------------------------------------------------------------------------- /communication/.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | 4 | # Libraries 5 | *.lib 6 | *.a 7 | 8 | # Shared objects (inc. Windows DLLs) 9 | *.dll 10 | *.so 11 | *.so.* 12 | *.dylib 13 | *.dSYM 14 | 15 | # Executables 16 | *.exe 17 | *.out 18 | *.app 19 | tests/testSparkCoreCommunication 20 | 21 | # Debug folder 22 | Debug/* 23 | 24 | # Release folder 25 | Release/* 26 | 27 | # build folder 28 | *.map 29 | *.lst 30 | *.d 31 | *.o 32 | 33 | # Platform-specific settings 34 | .settings/* 35 | .cproject 36 | .project 37 | .DS_Store 38 | -------------------------------------------------------------------------------- /communication/inc/tls_callbacks.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "wiced_result.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | typedef struct { 11 | uint8_t version; 12 | uint64_t (*tls_host_get_time_ms)(); 13 | void* (*tls_host_malloc)(const char*, uint32_t); 14 | void (*tls_host_free)(void*); 15 | wiced_result_t (*wiced_crypto_get_random)(void*, uint16_t); 16 | } TlsCallbacks; 17 | 18 | int tls_set_callbacks(TlsCallbacks callbacks); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif -------------------------------------------------------------------------------- /communication/makefile: -------------------------------------------------------------------------------- 1 | 2 | MODULE=communication 3 | COMMUNICATION_MODULE_PATH=. 4 | 5 | # Target this makefile is building. 6 | TARGET_TYPE = a 7 | 8 | BUILD_PATH_EXT=$(COMMUNICATION_BUILD_PATH_EXT) 9 | 10 | DEPENDENCIES = hal platform dynalib services wiring crypto 11 | 12 | include ../build/arm-tlm.mk 13 | -------------------------------------------------------------------------------- /communication/src/communication_diagnostic.h: -------------------------------------------------------------------------------- 1 | #include "spark_wiring_diagnostics.h" 2 | 3 | extern particle::SimpleUnsignedIntegerDiagnosticData g_rateLimitedEventsCounter; 4 | extern particle::SimpleUnsignedIntegerDiagnosticData g_unacknowledgedMessageCounter; 5 | extern particle::SimpleUnsignedIntegerDiagnosticData g_trasmittedMessageCounter; 6 | extern particle::SimpleUnsignedIntegerDiagnosticData g_retransmittedMessageCounter; 7 | extern particle::SimpleUnsignedIntegerDiagnosticData g_coapRoundTripMSec; 8 | -------------------------------------------------------------------------------- /communication/src/include.mk: -------------------------------------------------------------------------------- 1 | 2 | INCLUDE_DIRS += $(COMMUNICATION_MODULE_PATH)/inc 3 | 4 | -------------------------------------------------------------------------------- /communication/tests/Main.cpp: -------------------------------------------------------------------------------- 1 | #include "UnitTest++.h" 2 | 3 | int main(int, char const *[]) 4 | { 5 | return UnitTest::RunAllTests(); 6 | } 7 | -------------------------------------------------------------------------------- /communication/tests/TestStateMachine.cpp: -------------------------------------------------------------------------------- 1 | #include "UnitTest++.h" 2 | #include "core_protocol.h" 3 | 4 | SUITE(StateMachine) 5 | { 6 | TEST(InitialStateIs_READ_NONCE) 7 | { 8 | CoreProtocol core_protocol; 9 | ProtocolState::Enum state = core_protocol.state(); 10 | CHECK_EQUAL(ProtocolState::READ_NONCE, state); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /communication/tests/UnitTest++/src/CurrentTest.cpp: -------------------------------------------------------------------------------- 1 | #include "CurrentTest.h" 2 | #include 3 | 4 | namespace UnitTest { 5 | 6 | TestResults*& CurrentTest::Results() 7 | { 8 | static TestResults* testResults = NULL; 9 | return testResults; 10 | } 11 | 12 | const TestDetails*& CurrentTest::Details() 13 | { 14 | static const TestDetails* testDetails = NULL; 15 | return testDetails; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /communication/tests/UnitTest++/src/CurrentTest.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_CURRENTTESTRESULTS_H 2 | #define UNITTEST_CURRENTTESTRESULTS_H 3 | 4 | namespace UnitTest { 5 | 6 | class TestResults; 7 | class TestDetails; 8 | 9 | namespace CurrentTest 10 | { 11 | TestResults*& Results(); 12 | const TestDetails*& Details(); 13 | } 14 | 15 | } 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /communication/tests/UnitTest++/src/Posix/TimeHelpers.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TIMEHELPERS_H 2 | #define UNITTEST_TIMEHELPERS_H 3 | 4 | #include 5 | 6 | namespace UnitTest { 7 | 8 | class Timer 9 | { 10 | public: 11 | Timer(); 12 | void Start(); 13 | double GetTimeInMs() const; 14 | 15 | private: 16 | struct timeval m_startTime; 17 | }; 18 | 19 | 20 | namespace TimeHelpers 21 | { 22 | void SleepMs (int ms); 23 | } 24 | 25 | 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /communication/tests/UnitTest++/src/ReportAssert.cpp: -------------------------------------------------------------------------------- 1 | #include "ReportAssert.h" 2 | #include "AssertException.h" 3 | 4 | namespace UnitTest { 5 | 6 | void ReportAssert(char const* description, char const* filename, int lineNumber) 7 | { 8 | throw AssertException(description, filename, lineNumber); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /communication/tests/UnitTest++/src/ReportAssert.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_ASSERT_H 2 | #define UNITTEST_ASSERT_H 3 | 4 | namespace UnitTest { 5 | 6 | void ReportAssert(char const* description, char const* filename, int lineNumber); 7 | 8 | } 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /communication/tests/UnitTest++/src/TestList.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TESTLIST_H 2 | #define UNITTEST_TESTLIST_H 3 | 4 | 5 | namespace UnitTest { 6 | 7 | class Test; 8 | 9 | class TestList 10 | { 11 | public: 12 | TestList(); 13 | void Add (Test* test); 14 | 15 | Test* GetHead() const; 16 | 17 | private: 18 | Test* m_head; 19 | Test* m_tail; 20 | }; 21 | 22 | 23 | class ListAdder 24 | { 25 | public: 26 | ListAdder(TestList& list, Test* test); 27 | }; 28 | 29 | } 30 | 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /communication/tests/UnitTest++/src/TestReporter.cpp: -------------------------------------------------------------------------------- 1 | #include "TestReporter.h" 2 | 3 | namespace UnitTest { 4 | 5 | 6 | TestReporter::~TestReporter() 7 | { 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /communication/tests/UnitTest++/src/TestSuite.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TESTSUITE_H 2 | #define UNITTEST_TESTSUITE_H 3 | 4 | namespace UnitTestSuite 5 | { 6 | inline char const* GetSuiteName () 7 | { 8 | return "DefaultSuite"; 9 | } 10 | } 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /communication/tests/UnitTest++/src/TimeHelpers.h: -------------------------------------------------------------------------------- 1 | #include "Config.h" 2 | 3 | #if defined UNITTEST_POSIX 4 | #include "Posix/TimeHelpers.h" 5 | #else 6 | #include "Win32/TimeHelpers.h" 7 | #endif 8 | -------------------------------------------------------------------------------- /communication/tests/UnitTest++/src/UnitTest++.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTESTCPP_H 2 | #define UNITTESTCPP_H 3 | 4 | //lint -esym(1509,*Fixture) 5 | 6 | #include "Config.h" 7 | #include "Test.h" 8 | #include "TestList.h" 9 | #include "TestSuite.h" 10 | #include "TestResults.h" 11 | 12 | #include "TestMacros.h" 13 | 14 | #include "CheckMacros.h" 15 | #include "TestRunner.h" 16 | #include "TimeConstraint.h" 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /crypto-dynalib/import.mk: -------------------------------------------------------------------------------- 1 | CRYPTO_DYNALIB_MODULE_NAME = crypto-dynalib 2 | CRYPTO_DYNALIB_MODULE_PATH ?= $(PROJECT_ROOT)/$(CRYPTO_DYNALIB_MODULE_NAME) 3 | include $(call rwildcard,$(CRYPTO_DYNALIB_MODULE_PATH)/,include.mk) 4 | 5 | CRYPTO_DYNALIB_BUILD_PATH_EXT=$(BUILD_TARGET_PLATFORM) 6 | CRYPTO_DYNALIB_LIB_DIR = $(BUILD_PATH_BASE)/$(CRYPTO_DYNALIB_MODULE_NAME)/$(CRYPTO_DYNALIB_BUILD_PATH_EXT) 7 | CRYPTO_DYNALIB_LIB_DEP = $(CRYPTO_DYNALIB_LIB_DIR)/lib$(CRYPTO_DYNALIB_MODULE_NAME).a 8 | 9 | -------------------------------------------------------------------------------- /crypto-dynalib/makefile: -------------------------------------------------------------------------------- 1 | 2 | MODULE=crypto-dynalib 3 | CRYPTO_DYNALIB_MODULE_PATH=. 4 | 5 | # Target this makefile is building. 6 | TARGET_TYPE = a 7 | BUILD_PATH_EXT=$(CRYPTO_DYNALIB_BUILD_PATH_EXT) 8 | 9 | DEPENDENCIES = crypto dynalib hal 10 | 11 | include ../build/arm-tlm.mk 12 | -------------------------------------------------------------------------------- /crypto-dynalib/src/build.mk: -------------------------------------------------------------------------------- 1 | TARGET_CRYPTO_DYNALIB_SRC_PATH = $(CRYPTO_DYNALIB_MODULE_PATH)/src 2 | 3 | CPPSRC += $(call target_files,$(TARGET_CRYPTO_DYNALIB_SRC_PATH),*.cpp) 4 | CSRC += $(call target_files,$(TARGET_CRYPTO_DYNALIB_SRC_PATH),*.c) 5 | -------------------------------------------------------------------------------- /crypto-dynalib/src/crypto_dynalib.c: -------------------------------------------------------------------------------- 1 | 2 | #define DYNALIB_IMPORT 3 | #include "crypto_dynalib.h" 4 | 5 | -------------------------------------------------------------------------------- /crypto/import.mk: -------------------------------------------------------------------------------- 1 | CRYPTO_MODULE_NAME = crypto 2 | CRYPTO_MODULE_PATH ?= $(PROJECT_ROOT)/$(CRYPTO_MODULE_NAME) 3 | include $(call rwildcard,$(CRYPTO_MODULE_PATH)/,include.mk) 4 | 5 | CRYPTO_BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM) 6 | CRYPTO_LIB_DIR = $(BUILD_PATH_BASE)/$(CRYPTO_MODULE_NAME)/$(CRYPTO_BUILD_PATH_EXT) 7 | CRYPTO_LIB_DEP = $(CRYPTO_LIB_DIR)/lib$(CRYPTO_MODULE_NAME).a 8 | 9 | CFLAGS += -DMBEDTLS_CONFIG_FILE="" 10 | -------------------------------------------------------------------------------- /crypto/inc/include.mk: -------------------------------------------------------------------------------- 1 | TARGET_CRYPTO_PATH = $(CRYPTO_MODULE_PATH) 2 | INCLUDE_DIRS += $(TARGET_CRYPTO_PATH)/inc 3 | 4 | CRYPTO_DEPS = third_party/mbedtls 5 | CRYPTO_DEPS_INCLUDE_SCRIPTS =$(foreach module,$(CRYPTO_DEPS),$(PROJECT_ROOT)/$(module)/import.mk) 6 | include $(CRYPTO_DEPS_INCLUDE_SCRIPTS) 7 | 8 | CRYPTO_LIB_DEP += $(MBEDTLS_LIB_DEP) 9 | LIBS += $(notdir $(CRYPTO_DEPS)) 10 | LIB_DIRS += $(MBEDTLS_LIB_DIR) 11 | -------------------------------------------------------------------------------- /crypto/makefile: -------------------------------------------------------------------------------- 1 | 2 | MODULE=crypto 3 | CRYPTO_MODULE_PATH=. 4 | 5 | # Target this makefile is building. 6 | TARGET_TYPE = a 7 | 8 | BUILD_PATH_EXT=$(CRYPTO_BUILD_PATH_EXT) 9 | 10 | DEPENDENCIES = dynalib hal platform services third_party/mbedtls 11 | MAKE_DEPENDENCIES = third_party/mbedtls 12 | 13 | include ../build/arm-tlm.mk 14 | -------------------------------------------------------------------------------- /crypto/src/build.mk: -------------------------------------------------------------------------------- 1 | 2 | TARGET_SPARK_CRYPTO_SRC_PATH = $(CRYPTO_MODULE_PATH)/src 3 | 4 | CPPSRC += $(call target_files,$(TARGET_SPARK_CRYPTO_SRC_PATH),*.cpp) 5 | CSRC += $(call target_files,$(TARGET_SPARK_CRYPTO_SRC_PATH),*.c) 6 | 7 | LOG_MODULE_CATEGORY = crypto 8 | 9 | -------------------------------------------------------------------------------- /docs/doxygen/index.html: -------------------------------------------------------------------------------- 1 | html/index.html -------------------------------------------------------------------------------- /docs/doxygen/mainpage.md: -------------------------------------------------------------------------------- 1 | # Particle Firmware API 2 | -------------------------------------------------------------------------------- /dynalib/import.mk: -------------------------------------------------------------------------------- 1 | DYNALIB_MODULE_NAME=dynalib 2 | DYNALIB_MODULE_PATH ?= $(PROJECT_ROOT)/$(DYNALIB_MODULE_NAME) 3 | include $(call rwildcard,$(DYNALIB_MODULE_PATH)/,include.mk) 4 | 5 | DYNALIB_BUILD_PATH_EXT=$(BUILD_TARGET_PLATFORM) 6 | DYNALIB_LIB_DIR = $(BUILD_PATH_BASE)/$(DYNALIB_MODULE_NAME)/$(DYNALIB_BUILD_PATH_EXT) 7 | DYNALIB_LIB_DEP = $(DYNALIB_LIB_DIR)/lib$(DYNALIB_MODULE_NAME).a 8 | -------------------------------------------------------------------------------- /dynalib/inc/include.mk: -------------------------------------------------------------------------------- 1 | 2 | TARGET_DYNALIB_PATH=$(DYNALIB_MODULE_PATH) 3 | 4 | INCLUDE_DIRS += $(TARGET_DYNALIB_PATH)/inc 5 | INCLUDE_DIRS += $(PROJECT_ROOT)/hal/shared -------------------------------------------------------------------------------- /dynalib/makefile: -------------------------------------------------------------------------------- 1 | 2 | MODULE=dynalib 3 | DYNALIB_MODULE_PATH=. 4 | PROJECT_ROOT ?= .. 5 | 6 | # Target this makefile is building. 7 | TARGET_TYPE = a 8 | BUILD_PATH_EXT=$(DYNALIB_BUILD_PATH_EXT) 9 | DEPENDENCIES= 10 | 11 | include ../build/arm-tlm.mk 12 | -------------------------------------------------------------------------------- /dynalib/src/build.mk: -------------------------------------------------------------------------------- 1 | 2 | TARGET_DYNALIB_SRC_PATH = $(DYNALIB_MODULE_PATH)/src 3 | 4 | CPPSRC += $(call target_files,$(TARGET_DYNALIB_SRC_PATH),*.cpp) 5 | CSRC += $(call target_files,$(TARGET_DYNALIB_SRC_PATH),*.c) 6 | 7 | -------------------------------------------------------------------------------- /gsm0710muxer/build.mk: -------------------------------------------------------------------------------- 1 | TARGET_GSM0710MUXER_SRC_PATH = $(GSM0710MUXER_MODULE_PATH)/gsm0710muxer/src 2 | 3 | # C++ source files included in this build. 4 | CPPSRC += $(TARGET_GSM0710MUXER_SRC_PATH)/muxer.cpp 5 | 6 | -------------------------------------------------------------------------------- /gsm0710muxer/import.mk: -------------------------------------------------------------------------------- 1 | GSM0710MUXER_MODULE_NAME = gsm0710muxer 2 | GSM0710MUXER_MODULE_PATH ?= $(PROJECT_ROOT)/$(GSM0710MUXER_MODULE_NAME) 3 | include $(call rwildcard,$(GSM0710MUXER_MODULE_PATH)/,include.mk) 4 | 5 | GSM0710MUXER_BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM) 6 | GSM0710MUXER_LIB_DIR = $(BUILD_PATH_BASE)/$(GSM0710MUXER_MODULE_NAME)/$(GSM0710MUXER_BUILD_PATH_EXT) 7 | GSM0710MUXER_LIB_DEP = $(GSM0710MUXER_LIB_DIR)/lib$(GSM0710MUXER_MODULE_NAME).a 8 | -------------------------------------------------------------------------------- /gsm0710muxer/include.mk: -------------------------------------------------------------------------------- 1 | TARGET_GSM0710MUXER_PATH = $(GSM0710MUXER_MODULE_PATH) 2 | INCLUDE_DIRS += $(GSM0710MUXER_MODULE_PATH)/gsm0710muxer/include 3 | -------------------------------------------------------------------------------- /gsm0710muxer/makefile: -------------------------------------------------------------------------------- 1 | MODULE=gsm0710muxer 2 | GSM0710MUXER_MODULE_PATH=. 3 | 4 | # Target this makefile is building. 5 | TARGET_TYPE = a 6 | 7 | BUILD_PATH_EXT=$(GSM0710MUXER_BUILD_PATH_EXT) 8 | 9 | DEPENDENCIES = hal services platform 10 | 11 | # PROJECT_ROOT ?= ../.. 12 | include ../build/arm-tlm.mk 13 | -------------------------------------------------------------------------------- /hal-dynalib/import.mk: -------------------------------------------------------------------------------- 1 | HAL_DYNALIB_MODULE_NAME = hal-dynalib 2 | HAL_DYNALIB_MODULE_PATH ?= $(PROJECT_ROOT)/$(HAL_DYNALIB_MODULE_NAME) 3 | include $(call rwildcard,$(HAL_DYNALIB_MODULE_PATH)/,include.mk) 4 | 5 | HAL_DYNALIB_BUILD_PATH_EXT=$(BUILD_TARGET_PLATFORM) 6 | HAL_DYNALIB_LIB_DIR = $(BUILD_PATH_BASE)/$(HAL_DYNALIB_MODULE_NAME)/$(HAL_DYNALIB_BUILD_PATH_EXT) 7 | HAL_DYNALIB_LIB_DEP = $(HAL_DYNALIB_LIB_DIR)/lib$(HAL_DYNALIB_MODULE_NAME).a 8 | -------------------------------------------------------------------------------- /hal-dynalib/makefile: -------------------------------------------------------------------------------- 1 | 2 | MODULE=hal-dynalib 3 | HAL_DYNALIB_MODULE_PATH=. 4 | 5 | # Target this makefile is building. 6 | TARGET_TYPE = a 7 | BUILD_PATH_EXT = $(HAL_DYNALIB_BUILD_PATH_EXT) 8 | 9 | DEPENDENCIES = hal services dynalib platform 10 | 11 | include ../build/arm-tlm.mk 12 | 13 | -------------------------------------------------------------------------------- /hal-dynalib/readme.md: -------------------------------------------------------------------------------- 1 | A dynamic-link implementation of the hal module. 2 | -------------------------------------------------------------------------------- /hal-dynalib/src/build.mk: -------------------------------------------------------------------------------- 1 | 2 | TARGET_HAL_DYNALIB_SRC_PATH = $(HAL_DYNALIB_MODULE_PATH)/src 3 | 4 | CPPSRC += $(call target_files,$(TARGET_HAL_DYNALIB_SRC_PATH),*.cpp) 5 | CSRC += $(call target_files,$(TARGET_HAL_DYNALIB_SRC_PATH),*.c) 6 | 7 | CFLAGS += -DDYNALIB_IMPORT 8 | -------------------------------------------------------------------------------- /hal-dynalib/src/hal_backup_ram.c: -------------------------------------------------------------------------------- 1 | #include "hal_dynalib_backup_ram.h" 2 | -------------------------------------------------------------------------------- /hal-dynalib/src/hal_ble.c: -------------------------------------------------------------------------------- 1 | #include "hal_dynalib_ble.h" 2 | -------------------------------------------------------------------------------- /hal-dynalib/src/hal_bootloader.c: -------------------------------------------------------------------------------- 1 | #ifndef HAL_BOOTLOADER_EXCLUDE 2 | #include "hal_dynalib_bootloader.h" 3 | #endif 4 | -------------------------------------------------------------------------------- /hal-dynalib/src/hal_can.c: -------------------------------------------------------------------------------- 1 | #include "hal_dynalib_can.h" 2 | -------------------------------------------------------------------------------- /hal-dynalib/src/hal_cellular.c: -------------------------------------------------------------------------------- 1 | #include "hal_platform.h" 2 | 3 | #if HAL_PLATFORM_CELLULAR 4 | #include "hal_dynalib_cellular.h" 5 | #endif 6 | -------------------------------------------------------------------------------- /hal-dynalib/src/hal_concurrent.c: -------------------------------------------------------------------------------- 1 | #include "hal_dynalib_concurrent.h" 2 | -------------------------------------------------------------------------------- /hal-dynalib/src/hal_core.c: -------------------------------------------------------------------------------- 1 | #include "hal_dynalib_core.h" 2 | -------------------------------------------------------------------------------- /hal-dynalib/src/hal_dct.c: -------------------------------------------------------------------------------- 1 | #include "hal_dynalib_dct.h" 2 | -------------------------------------------------------------------------------- /hal-dynalib/src/hal_dynalib.c: -------------------------------------------------------------------------------- 1 | #include "hal_dynalib.h" 2 | -------------------------------------------------------------------------------- /hal-dynalib/src/hal_gpio.c: -------------------------------------------------------------------------------- 1 | #include "hal_dynalib_gpio.h" 2 | -------------------------------------------------------------------------------- /hal-dynalib/src/hal_i2c.c: -------------------------------------------------------------------------------- 1 | #include "hal_dynalib_i2c.h" 2 | -------------------------------------------------------------------------------- /hal-dynalib/src/hal_nfc.c: -------------------------------------------------------------------------------- 1 | #include "hal_dynalib_nfc.h" 2 | -------------------------------------------------------------------------------- /hal-dynalib/src/hal_peripherals.c: -------------------------------------------------------------------------------- 1 | #include "hal_dynalib_peripherals.h" 2 | -------------------------------------------------------------------------------- /hal-dynalib/src/hal_rgbled.c: -------------------------------------------------------------------------------- 1 | #include "hal_dynalib_rgbled.h" 2 | -------------------------------------------------------------------------------- /hal-dynalib/src/hal_socket.c: -------------------------------------------------------------------------------- 1 | #include "hal_dynalib_socket.h" 2 | -------------------------------------------------------------------------------- /hal-dynalib/src/hal_spi.c: -------------------------------------------------------------------------------- 1 | #include "hal_dynalib_spi.h" 2 | -------------------------------------------------------------------------------- /hal-dynalib/src/hal_storage.c: -------------------------------------------------------------------------------- 1 | #include "hal_dynalib_storage.h" 2 | -------------------------------------------------------------------------------- /hal-dynalib/src/hal_usart.c: -------------------------------------------------------------------------------- 1 | #include "hal_dynalib_usart.h" 2 | -------------------------------------------------------------------------------- /hal-dynalib/src/hal_usb.c: -------------------------------------------------------------------------------- 1 | #ifndef HAL_USB_EXCLUDE 2 | #include "hal_dynalib_usb.h" 3 | #endif 4 | -------------------------------------------------------------------------------- /hal-dynalib/src/hal_watchdog.c: -------------------------------------------------------------------------------- 1 | #include "hal_dynalib_watchdog.h" 2 | -------------------------------------------------------------------------------- /hal-dynalib/src/hal_wlan.c: -------------------------------------------------------------------------------- 1 | #include "hal_platform.h" 2 | 3 | #if HAL_PLATFORM_WIFI 4 | #include "hal_dynalib_wlan.h" 5 | #endif 6 | -------------------------------------------------------------------------------- /hal/build.mk: -------------------------------------------------------------------------------- 1 | 2 | # all build.mk files are loaded recursively 3 | # This project has these build.mk files which act as "gatekeepers" 4 | # pulling in the required sources. 5 | # (Include files are selected in import.mk) 6 | 7 | HAL_PLATFORM_SRC_PATH = $(HAL_MODULE_PATH)/src/$(PLATFORM_NAME) 8 | include $(call rwildcard,$(HAL_PLATFORM_SRC_PATH)/,sources.mk) 9 | 10 | LOG_MODULE_CATEGORY = hal 11 | 12 | ifneq (,$(filter $(PLATFORM_ID),13 15 23 25 26 37)) 13 | ifneq ($(DEBUG_BUILD),y) 14 | CFLAGS += -DLOG_COMPILE_TIME_LEVEL=LOG_LEVEL_ERROR 15 | endif 16 | endif 17 | -------------------------------------------------------------------------------- /hal/import.mk: -------------------------------------------------------------------------------- 1 | HAL_MODULE_NAME=hal 2 | HAL_MODULE_PATH?=$(PROJECT_ROOT)/$(HAL_MODULE_NAME) 3 | 4 | HAL_BUILD_PATH_EXT=$(BUILD_TARGET_PLATFORM)$(HAL_TEST_FLAVOR) 5 | HAL_LIB_DIR = $(BUILD_PATH_BASE)/$(HAL_MODULE_NAME)/$(HAL_BUILD_PATH_EXT) 6 | HAL_LIB_DEP = $(HAL_LIB_DIR)/lib$(HAL_MODULE_NAME).a 7 | 8 | include $(call rwildcard,$(HAL_MODULE_PATH)/inc/,include.mk) 9 | include $(call rwildcard,$(HAL_MODULE_PATH)/src/$(PLATFORM_NAME)/,include.mk) 10 | include $(call rwildcard,$(HAL_MODULE_PATH)/shared/,include.mk) 11 | 12 | -------------------------------------------------------------------------------- /hal/inc/hal_irq_flag.h: -------------------------------------------------------------------------------- 1 | #ifndef __HAL_IRQ_FLAG_H 2 | #define __HAL_IRQ_FLAG_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif // __cplusplus 7 | int HAL_disable_irq(); 8 | void HAL_enable_irq(int mask); 9 | #ifdef __cplusplus 10 | } 11 | #endif // __cplusplus 12 | 13 | #endif // __HAL_IRQ_FLAG_H 14 | -------------------------------------------------------------------------------- /hal/inc/include.mk: -------------------------------------------------------------------------------- 1 | 2 | TARGET_HAL_PATH = $(HAL_MODULE_PATH) 3 | INCLUDE_DIRS += $(TARGET_HAL_PATH)/inc 4 | -------------------------------------------------------------------------------- /hal/makefile: -------------------------------------------------------------------------------- 1 | 2 | MODULE=hal 3 | HAL_MODULE_PATH=. 4 | 5 | # Target this makefile is building. 6 | TARGET_TYPE = a 7 | BUILD_PATH_EXT = $(HAL_BUILD_PATH_EXT) 8 | 9 | DEPENDENCIES = newlib_nano platform services dynalib bootloader wiring crypto proto_defs 10 | 11 | # ensure PLATFORM_NAME is defined 12 | include ../build/platform-id.mk 13 | -include $(HAL_MODULE_PATH)/src/$(PLATFORM_NAME)/tlm.mk 14 | 15 | 16 | include ../build/arm-tlm.mk 17 | 18 | -------------------------------------------------------------------------------- /hal/shared/flash_device_hal.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef FLASH_DEVICE_HAL_H 3 | #define FLASH_DEVICE_HAL_H 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | typedef enum flash_device_t { 10 | FLASH_INTERNAL, 11 | FLASH_SERIAL, 12 | FLASH_ADDRESS // Address that is directly accessible (e.g. RAM) 13 | } flash_device_t; 14 | 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif /* FLASH_DEVICE_HAL_H */ 21 | 22 | -------------------------------------------------------------------------------- /hal/shared/include.mk: -------------------------------------------------------------------------------- 1 | 2 | INCLUDE_DIRS += $(TARGET_HAL_PATH)/shared 3 | -------------------------------------------------------------------------------- /hal/src/argon/bootloader_platform_12.c: -------------------------------------------------------------------------------- 1 | const unsigned char bootloader_platform_12_bin_miniz[] = { 2 | 3 | }; 4 | const unsigned int bootloader_platform_12_bin_miniz_len = 0; 5 | -------------------------------------------------------------------------------- /hal/src/argon/bootloader_platform_22.c: -------------------------------------------------------------------------------- 1 | const unsigned char bootloader_platform_22_bin_miniz[] = { 2 | 3 | }; 4 | const unsigned int bootloader_platform_22_bin_miniz_len = 0; 5 | 6 | -------------------------------------------------------------------------------- /hal/src/argon/include.mk: -------------------------------------------------------------------------------- 1 | 2 | # Define the prefix to this directory. 3 | # Note: The name must be unique within this build and should be 4 | # based on the root of the project 5 | 6 | INCLUDE_DIRS += $(TARGET_HAL_PATH)/src/$(PLATFORM_NAME) 7 | 8 | ifneq (,$(findstring platform,$(DEPENDENCIES))) 9 | INCLUDE_DIRS += $(HAL_MODULE_PATH)/network/lwip/esp32 10 | INCLUDE_DIRS += $(HAL_MODULE_PATH)/network/ncp/wifi 11 | endif 12 | 13 | 14 | include $(TARGET_HAL_PATH)/src/nRF52840/include.mk 15 | -------------------------------------------------------------------------------- /hal/src/argon/tlm.mk: -------------------------------------------------------------------------------- 1 | # this is included in the top-level-module makefile to provide 2 | # HAL-specific defines 3 | 4 | include $(HAL_MODULE_PATH)/src/nRF52840/tlm.mk 5 | 6 | DEPENDENCIES += system 7 | -------------------------------------------------------------------------------- /hal/src/argon/user_platform_22.c: -------------------------------------------------------------------------------- 1 | const unsigned char user_platform_22_bin[] = { 2 | 3 | }; 4 | const unsigned int user_platform_22_bin_len = 0; 5 | -------------------------------------------------------------------------------- /hal/src/b5som/include.mk: -------------------------------------------------------------------------------- 1 | 2 | # Define the prefix to this directory. 3 | # Note: The name must be unique within this build and should be 4 | # based on the root of the project 5 | 6 | INCLUDE_DIRS += $(TARGET_HAL_PATH)/src/$(PLATFORM_NAME) 7 | 8 | ifneq (,$(findstring platform,$(DEPENDENCIES))) 9 | INCLUDE_DIRS += $(HAL_MODULE_PATH)/network/lwip/cellular 10 | endif 11 | 12 | 13 | include $(TARGET_HAL_PATH)/src/nRF52840/include.mk 14 | -------------------------------------------------------------------------------- /hal/src/b5som/tlm.mk: -------------------------------------------------------------------------------- 1 | # this is included in the top-level-module makefile to provide 2 | # HAL-specific defines 3 | 4 | include $(HAL_MODULE_PATH)/src/nRF52840/tlm.mk 5 | 6 | DEPENDENCIES += system 7 | -------------------------------------------------------------------------------- /hal/src/b5som/user_platform_25.c: -------------------------------------------------------------------------------- 1 | const unsigned char user_platform_25_bin[] = { 2 | 3 | }; 4 | const unsigned int user_platform_25_bin_len = 0; 5 | -------------------------------------------------------------------------------- /hal/src/boron/bootloader_platform_13.c: -------------------------------------------------------------------------------- 1 | const unsigned char bootloader_platform_13_bin_miniz[] = { 2 | 3 | }; 4 | const unsigned int bootloader_platform_13_bin_miniz_len = 0; 5 | 6 | -------------------------------------------------------------------------------- /hal/src/boron/bootloader_platform_23.c: -------------------------------------------------------------------------------- 1 | const unsigned char bootloader_platform_23_bin_miniz[] = { 2 | 3 | }; 4 | const unsigned int bootloader_platform_23_bin_miniz_len = 0; 5 | 6 | -------------------------------------------------------------------------------- /hal/src/boron/include.mk: -------------------------------------------------------------------------------- 1 | 2 | # Define the prefix to this directory. 3 | # Note: The name must be unique within this build and should be 4 | # based on the root of the project 5 | 6 | INCLUDE_DIRS += $(TARGET_HAL_PATH)/src/$(PLATFORM_NAME) 7 | 8 | ifneq (,$(findstring platform,$(DEPENDENCIES))) 9 | INCLUDE_DIRS += $(HAL_MODULE_PATH)/network/lwip/cellular 10 | endif 11 | 12 | 13 | include $(TARGET_HAL_PATH)/src/nRF52840/include.mk 14 | -------------------------------------------------------------------------------- /hal/src/boron/tlm.mk: -------------------------------------------------------------------------------- 1 | # this is included in the top-level-module makefile to provide 2 | # HAL-specific defines 3 | 4 | include $(HAL_MODULE_PATH)/src/nRF52840/tlm.mk 5 | 6 | DEPENDENCIES += system 7 | -------------------------------------------------------------------------------- /hal/src/boron/user_platform_23.c: -------------------------------------------------------------------------------- 1 | const unsigned char user_platform_23_bin[] = { 2 | 3 | }; 4 | const unsigned int user_platform_23_bin_len = 0; 5 | -------------------------------------------------------------------------------- /hal/src/electron2/include.mk: -------------------------------------------------------------------------------- 1 | 2 | # Define the prefix to this directory. 3 | # Note: The name must be unique within this build and should be 4 | # based on the root of the project 5 | 6 | INCLUDE_DIRS += $(TARGET_HAL_PATH)/src/$(PLATFORM_NAME) 7 | 8 | ifneq (,$(findstring platform,$(DEPENDENCIES))) 9 | INCLUDE_DIRS += $(HAL_MODULE_PATH)/network/lwip/cellular 10 | endif 11 | 12 | 13 | include $(TARGET_HAL_PATH)/src/nRF52840/include.mk 14 | -------------------------------------------------------------------------------- /hal/src/electron2/tlm.mk: -------------------------------------------------------------------------------- 1 | # this is included in the top-level-module makefile to provide 2 | # HAL-specific defines 3 | 4 | include $(HAL_MODULE_PATH)/src/nRF52840/tlm.mk 5 | 6 | DEPENDENCIES += system 7 | -------------------------------------------------------------------------------- /hal/src/gcc/boost_asio_impl_src_wrap.h: -------------------------------------------------------------------------------- 1 | #pragma GCC system_header 2 | #include -------------------------------------------------------------------------------- /hal/src/gcc/boost_asio_wrap.h: -------------------------------------------------------------------------------- 1 | #pragma GCC system_header 2 | #include 3 | -------------------------------------------------------------------------------- /hal/src/gcc/boost_json.h: -------------------------------------------------------------------------------- 1 | // Disabling -Wundef via a pragma is broken in GCC: 2 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431 3 | #pragma GCC system_header 4 | #include 5 | -------------------------------------------------------------------------------- /hal/src/gcc/boost_posix_time_wrap.h: -------------------------------------------------------------------------------- 1 | #pragma GCC system_header 2 | #include 3 | -------------------------------------------------------------------------------- /hal/src/gcc/boost_program_options_wrap.h: -------------------------------------------------------------------------------- 1 | #pragma GCC system_header 2 | #include 3 | -------------------------------------------------------------------------------- /hal/src/gcc/boost_signals2_wrap.h: -------------------------------------------------------------------------------- 1 | #pragma GCC system_header 2 | #include 3 | -------------------------------------------------------------------------------- /hal/src/gcc/boost_thread_wrap.h: -------------------------------------------------------------------------------- 1 | #pragma GCC system_header 2 | #include 3 | -------------------------------------------------------------------------------- /hal/src/gcc/bootloader.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot/device-os/99fd93b8965da95c112c6afb4058427109b1ad57/hal/src/gcc/bootloader.h -------------------------------------------------------------------------------- /hal/src/gcc/dct_hal.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot/device-os/99fd93b8965da95c112c6afb4058427109b1ad57/hal/src/gcc/dct_hal.h -------------------------------------------------------------------------------- /hal/src/gcc/device_globals.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #pragma once 4 | 5 | #pragma GCC diagnostic push 6 | #ifdef __clang__ 7 | // compiling with gcc this produces 8 | // src/gcc/device_globals.h:6:32: error: unknown option after '#pragma GCC diagnostic' kind [-Werror=pragmas] ^ 9 | // cc1plus: error: unrecognized command line option "-Wno-return-type-c-linkage" [-Werror] 10 | #pragma GCC diagnostic ignored "-Wunused-local-typedef" 11 | #endif 12 | #include "boost_asio_wrap.h" 13 | #pragma GCC diagnostic pop 14 | 15 | extern boost::asio::io_service device_io_service; 16 | -------------------------------------------------------------------------------- /hal/src/gcc/eeprom_file.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | void GCC_EEPROM_Load(const char* filename); 5 | 6 | void GCC_EEPROM_Save(const char* filename); 7 | 8 | 9 | -------------------------------------------------------------------------------- /hal/src/gcc/platform_headers.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef PLATFORM_HEADERS_H 3 | #define PLATFORM_HEADERS_H 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #define retained 10 | #define retained_system 11 | 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | #endif /* PLATFORM_HEADERS_H */ 18 | 19 | -------------------------------------------------------------------------------- /hal/src/gcc/rng_hal.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "rng_hal.h" 3 | #include 4 | 5 | using namespace boost::random; 6 | 7 | random_device rng; 8 | 9 | void HAL_RNG_Configuration(void) 10 | { 11 | } 12 | 13 | uint32_t HAL_RNG_GetRandomNumber(void) 14 | { 15 | return rng(); 16 | } 17 | -------------------------------------------------------------------------------- /hal/src/gcc/tlm.mk: -------------------------------------------------------------------------------- 1 | DEPENDENCIES += communication 2 | -------------------------------------------------------------------------------- /hal/src/msom/tlm.mk: -------------------------------------------------------------------------------- 1 | # this is included in the top-level-module makefile to provide 2 | # HAL-specific defines 3 | 4 | include $(HAL_MODULE_PATH)/src/rtl872x/tlm.mk 5 | 6 | DEPENDENCIES += system 7 | -------------------------------------------------------------------------------- /hal/src/nRF52840/lwip/lwippools.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot/device-os/99fd93b8965da95c112c6afb4058427109b1ad57/hal/src/nRF52840/lwip/lwippools.h -------------------------------------------------------------------------------- /hal/src/nRF52840/platform_headers.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * This header file can be used to control access to low-level platform 5 | * features in user code. Normally user code should access the platform via 6 | * the HAL. 7 | */ 8 | 9 | #define retained __attribute__((section(".retained_user"))) 10 | #define retained_system __attribute__((section(".retained_system"))) 11 | -------------------------------------------------------------------------------- /hal/src/nRF52840/syshealth_hal.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "syshealth_hal.h" 3 | 4 | eSystemHealth sys_health_cache; 5 | 6 | void HAL_Set_Sys_Health(eSystemHealth health) { 7 | if (health>sys_health_cache) 8 | { 9 | sys_health_cache = health; 10 | } 11 | } 12 | 13 | eSystemHealth HAL_Get_Sys_Health() { 14 | return sys_health_cache; 15 | } 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /hal/src/nRF52840/tlm.mk: -------------------------------------------------------------------------------- 1 | # this is included in the top-level-module makefile to provide 2 | # HAL-specific defines 3 | 4 | DEPENDENCIES += communication newlib_nano third_party/freertos third_party/lwip third_party/wiznet_driver gsm0710muxer 5 | MAKE_DEPENDENCIES += third_party/freertos third_party/lwip third_party/wiznet_driver gsm0710muxer 6 | -------------------------------------------------------------------------------- /hal/src/newhal/bootloader.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot/device-os/99fd93b8965da95c112c6afb4058427109b1ad57/hal/src/newhal/bootloader.h -------------------------------------------------------------------------------- /hal/src/newhal/dct.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot/device-os/99fd93b8965da95c112c6afb4058427109b1ad57/hal/src/newhal/dct.h -------------------------------------------------------------------------------- /hal/src/newhal/eeprom_emulation_impl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot/device-os/99fd93b8965da95c112c6afb4058427109b1ad57/hal/src/newhal/eeprom_emulation_impl.h -------------------------------------------------------------------------------- /hal/src/newhal/flash_storage_impl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot/device-os/99fd93b8965da95c112c6afb4058427109b1ad57/hal/src/newhal/flash_storage_impl.h -------------------------------------------------------------------------------- /hal/src/newhal/interrupts_irq.h: -------------------------------------------------------------------------------- 1 | #ifndef INTERRUPTS_IRQ_H 2 | #define INTERRUPTS_IRQ_H 3 | 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | typedef int32_t IRQn_Type; 11 | 12 | typedef enum hal_irq_t { 13 | __Last_irq = 0 14 | } hal_irq_t; 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif /* INTERRUPTS_IRQ_H */ 21 | -------------------------------------------------------------------------------- /hal/src/newhal/linker.ld: -------------------------------------------------------------------------------- 1 | 2 | /* Define your linker script here, or use an INCLUDE directive to include it 3 | from another file. (Uncomment and edit LD_FLAGS += -L/some/directory in `include.mk` 4 | to add the directory containing the external linker file to the linker search path.) 5 | */ 6 | -------------------------------------------------------------------------------- /hal/src/newhal/platform_headers.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * This header file can be used to control access to low-level platform 5 | * features in user code. Normally user code should access the platform via 6 | * the HAL. 7 | */ 8 | 9 | #define retained 10 | #define retained_system 11 | -------------------------------------------------------------------------------- /hal/src/newhal/tlm.mk: -------------------------------------------------------------------------------- 1 | # this is included in the top-level-module makefile to provide 2 | # HAL-specific defines 3 | -------------------------------------------------------------------------------- /hal/src/rtl872x/lwip/lwippools.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot/device-os/99fd93b8965da95c112c6afb4058427109b1ad57/hal/src/rtl872x/lwip/lwippools.h -------------------------------------------------------------------------------- /hal/src/rtl872x/syshealth_hal.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "syshealth_hal.h" 3 | 4 | eSystemHealth sys_health_cache; 5 | 6 | void HAL_Set_Sys_Health(eSystemHealth health) { 7 | if (health>sys_health_cache) 8 | { 9 | sys_health_cache = health; 10 | } 11 | } 12 | 13 | eSystemHealth HAL_Get_Sys_Health() { 14 | return sys_health_cache; 15 | } 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /hal/src/rtl872x/tlm.mk: -------------------------------------------------------------------------------- 1 | # this is included in the top-level-module makefile to provide 2 | # HAL-specific defines 3 | 4 | DEPENDENCIES += communication newlib_nano third_party/freertos third_party/lwip third_party/wiznet_driver gsm0710muxer 5 | MAKE_DEPENDENCIES += third_party/freertos third_party/lwip third_party/wiznet_driver gsm0710muxer 6 | -------------------------------------------------------------------------------- /hal/src/template/platform_headers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: platform_headers.h 3 | * Author: mat 4 | * 5 | * Created on 10 October 2014, 11:04 6 | */ 7 | 8 | #ifndef PLATFORM_HEADERS_H 9 | #define PLATFORM_HEADERS_H 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | 16 | 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif /* PLATFORM_HEADERS_H */ 23 | 24 | -------------------------------------------------------------------------------- /hal/src/template/product_store_hal.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "product_store_hal.h" 3 | 4 | /** 5 | * Sets the value at a specific product store index. 6 | * @return The previous value. 7 | */ 8 | int HAL_SetProductStore(ProductStoreIndex index, uint16_t value) 9 | { 10 | return 0xFFFF; 11 | } 12 | 13 | /** 14 | * Fetches the value at a given index in the product store. 15 | * @param index 16 | * @return 17 | */ 18 | int HAL_GetProductStore(ProductStoreIndex index) 19 | { 20 | return 0xFFFF; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /hal/src/template/syshealth_hal.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "syshealth_hal.h" 3 | 4 | eSystemHealth sys_health_cache; 5 | 6 | void HAL_Set_Sys_Health(eSystemHealth health) { 7 | if (health>sys_health_cache) 8 | { 9 | sys_health_cache = health; 10 | } 11 | } 12 | 13 | eSystemHealth HAL_Get_Sys_Health() { 14 | return sys_health_cache; 15 | } 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /hal/src/tracker/tlm.mk: -------------------------------------------------------------------------------- 1 | # this is included in the top-level-module makefile to provide 2 | # HAL-specific defines 3 | 4 | include $(HAL_MODULE_PATH)/src/nRF52840/tlm.mk 5 | 6 | DEPENDENCIES += system 7 | -------------------------------------------------------------------------------- /hal/src/tracker/user_platform_26.c: -------------------------------------------------------------------------------- 1 | const unsigned char user_platform_26_bin[] = { 2 | 3 | }; 4 | const unsigned int user_platform_26_bin_len = 0; 5 | -------------------------------------------------------------------------------- /hal/src/trackerm/tlm.mk: -------------------------------------------------------------------------------- 1 | # this is included in the top-level-module makefile to provide 2 | # HAL-specific defines 3 | 4 | include $(HAL_MODULE_PATH)/src/rtl872x/tlm.mk 5 | 6 | DEPENDENCIES += system 7 | -------------------------------------------------------------------------------- /hal/src/tron/include.mk: -------------------------------------------------------------------------------- 1 | 2 | # Define the prefix to this directory. 3 | # Note: The name must be unique within this build and should be 4 | # based on the root of the project 5 | 6 | INCLUDE_DIRS += $(TARGET_HAL_PATH)/src/$(PLATFORM_NAME) 7 | # FIXME: There is no NCP on Tron 8 | INCLUDE_DIRS += $(HAL_MODULE_PATH)/network/ncp/wifi 9 | 10 | ifneq (,$(findstring platform,$(DEPENDENCIES))) 11 | INCLUDE_DIRS += $(HAL_MODULE_PATH)/network/lwip/esp32 12 | INCLUDE_DIRS += $(HAL_MODULE_PATH)/network/ncp/wifi 13 | endif 14 | 15 | include $(TARGET_HAL_PATH)/src/rtl872x/include.mk 16 | -------------------------------------------------------------------------------- /hal/src/tron/tlm.mk: -------------------------------------------------------------------------------- 1 | # this is included in the top-level-module makefile to provide 2 | # HAL-specific defines 3 | 4 | include $(HAL_MODULE_PATH)/src/rtl872x/tlm.mk 5 | 6 | DEPENDENCIES += system 7 | -------------------------------------------------------------------------------- /main/import.mk: -------------------------------------------------------------------------------- 1 | include $(PROJECT_ROOT)/modules/shared/system_module_version.mk 2 | 3 | MAIN_MODULE_VERSION ?= $(SYSTEM_PART1_MODULE_VERSION) 4 | -------------------------------------------------------------------------------- /main/src/build.mk: -------------------------------------------------------------------------------- 1 | 2 | TARGET_MAIN_SRC_PATH = $(MAIN_MODULE_PATH)/src 3 | 4 | CPPSRC += $(call target_files,$(TARGET_MAIN_SRC_PATH),*.cpp) 5 | CSRC += $(call target_files,$(TARGET_MAIN_SRC_PATH),*.c) 6 | 7 | -------------------------------------------------------------------------------- /main/src/module_info.c: -------------------------------------------------------------------------------- 1 | 2 | #include "module_info.inc" 3 | -------------------------------------------------------------------------------- /modules/argon/makefile: -------------------------------------------------------------------------------- 1 | include modular.mk 2 | 3 | %: 4 | $(MAKE) -C .. $(MAKECMDGOALS) 5 | -------------------------------------------------------------------------------- /modules/argon/system-part1/build.mk: -------------------------------------------------------------------------------- 1 | 2 | include ../../shared/nRF52840/part1_build.mk -------------------------------------------------------------------------------- /modules/argon/system-part1/import.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/system_module_version.mk 2 | SYSTEM_PART1_MODULE_PATH ?= $(PROJECT_ROOT)/modules/argon/system-part1 3 | 4 | ifeq ($(MINIMAL),y) 5 | GLOBAL_DEFINES += SYSTEM_MINIMAL 6 | endif 7 | 8 | include $(call rwildcard,$(SYSTEM_PART1_MODULE_PATH)/,include.mk) 9 | include $(call rwildcard,$(SHARED_MODULAR)/,include.mk) 10 | -------------------------------------------------------------------------------- /modules/argon/system-part1/src/export_rt.c: -------------------------------------------------------------------------------- 1 | #include "export_rt.inc" 2 | -------------------------------------------------------------------------------- /modules/argon/system-part1/src/export_system.cpp: -------------------------------------------------------------------------------- 1 | #include "export_system.inc" 2 | -------------------------------------------------------------------------------- /modules/argon/system-part1/src/import_user.c: -------------------------------------------------------------------------------- 1 | #include "import_user.inc" 2 | -------------------------------------------------------------------------------- /modules/argon/system-part1/src/import_user_compat.c: -------------------------------------------------------------------------------- 1 | #include "import_user_compat.inc" 2 | -------------------------------------------------------------------------------- /modules/argon/system-part1/src/module_info.c: -------------------------------------------------------------------------------- 1 | #include "module_info.inc" 2 | -------------------------------------------------------------------------------- /modules/argon/system-part1/src/module_system_part1.cpp: -------------------------------------------------------------------------------- 1 | #include "module_system_part1.inc" 2 | -------------------------------------------------------------------------------- /modules/argon/user-part/build.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/nRF52840/user_build.mk -------------------------------------------------------------------------------- /modules/argon/user-part/import.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/system_module_version.mk 2 | USER_PART_MODULE_PATH ?= $(PROJECT_ROOT)/modules/argon/user-part 3 | include $(call rwildcard,$(USER_PART_MODULE_PATH)/,include.mk) 4 | 5 | 6 | -------------------------------------------------------------------------------- /modules/argon/user-part/module_user_export.ld: -------------------------------------------------------------------------------- 1 | /* Dynalib table locations */ 2 | PROVIDE (link_dynalib_location_user = platform_user_part_dynalib_table_flash_start + 0); 3 | PROVIDE (link_dynalib_location_user_compat = platform_user_part_compat_dynalib_table_flash_start + 0 ); 4 | -------------------------------------------------------------------------------- /modules/argon/user-part/src/module_info.c: -------------------------------------------------------------------------------- 1 | #include "module_info.inc" 2 | -------------------------------------------------------------------------------- /modules/argon/user-part/src/newlib_stubs.cpp: -------------------------------------------------------------------------------- 1 | #include "newlib_stubs.inc" 2 | -------------------------------------------------------------------------------- /modules/argon/user-part/src/user_export.c: -------------------------------------------------------------------------------- 1 | #include "user_part_export.c" -------------------------------------------------------------------------------- /modules/argon/user-part/src/user_module.c: -------------------------------------------------------------------------------- 1 | #include "user_module.inc" 2 | -------------------------------------------------------------------------------- /modules/b5som/makefile: -------------------------------------------------------------------------------- 1 | include modular.mk 2 | 3 | %: 4 | $(MAKE) -C .. $(MAKECMDGOALS) 5 | -------------------------------------------------------------------------------- /modules/b5som/system-part1/build.mk: -------------------------------------------------------------------------------- 1 | 2 | include ../../shared/nRF52840/part1_build.mk -------------------------------------------------------------------------------- /modules/b5som/system-part1/import.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/system_module_version.mk 2 | SYSTEM_PART1_MODULE_PATH ?= $(PROJECT_ROOT)/modules/b5som/system-part1 3 | 4 | ifeq ($(MINIMAL),y) 5 | GLOBAL_DEFINES += SYSTEM_MINIMAL 6 | endif 7 | 8 | include $(call rwildcard,$(SYSTEM_PART1_MODULE_PATH)/,include.mk) 9 | include $(call rwildcard,$(SHARED_MODULAR)/,include.mk) 10 | -------------------------------------------------------------------------------- /modules/b5som/system-part1/src/export_rt.c: -------------------------------------------------------------------------------- 1 | #include "export_rt.inc" 2 | -------------------------------------------------------------------------------- /modules/b5som/system-part1/src/export_system.cpp: -------------------------------------------------------------------------------- 1 | #include "export_system.inc" 2 | -------------------------------------------------------------------------------- /modules/b5som/system-part1/src/import_user.c: -------------------------------------------------------------------------------- 1 | #include "import_user.inc" 2 | -------------------------------------------------------------------------------- /modules/b5som/system-part1/src/import_user_compat.c: -------------------------------------------------------------------------------- 1 | #include "import_user_compat.inc" 2 | -------------------------------------------------------------------------------- /modules/b5som/system-part1/src/module_info.c: -------------------------------------------------------------------------------- 1 | #include "module_info.inc" 2 | -------------------------------------------------------------------------------- /modules/b5som/system-part1/src/module_system_part1.cpp: -------------------------------------------------------------------------------- 1 | #include "module_system_part1.inc" 2 | -------------------------------------------------------------------------------- /modules/b5som/user-part/build.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/nRF52840/user_build.mk -------------------------------------------------------------------------------- /modules/b5som/user-part/import.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/system_module_version.mk 2 | USER_PART_MODULE_PATH ?= $(PROJECT_ROOT)/modules/b5som/user-part 3 | include $(call rwildcard,$(USER_PART_MODULE_PATH)/,include.mk) 4 | 5 | 6 | -------------------------------------------------------------------------------- /modules/b5som/user-part/module_user_export.ld: -------------------------------------------------------------------------------- 1 | /* Dynalib table locations */ 2 | PROVIDE (link_dynalib_location_user = platform_user_part_dynalib_table_flash_start + 0); 3 | PROVIDE (link_dynalib_location_user_compat = platform_user_part_compat_dynalib_table_flash_start + 0 ); 4 | -------------------------------------------------------------------------------- /modules/b5som/user-part/src/module_info.c: -------------------------------------------------------------------------------- 1 | #include "module_info.inc" 2 | -------------------------------------------------------------------------------- /modules/b5som/user-part/src/newlib_stubs.cpp: -------------------------------------------------------------------------------- 1 | #include "newlib_stubs.inc" 2 | -------------------------------------------------------------------------------- /modules/b5som/user-part/src/user_export.c: -------------------------------------------------------------------------------- 1 | #include "user_part_export.c" -------------------------------------------------------------------------------- /modules/b5som/user-part/src/user_module.c: -------------------------------------------------------------------------------- 1 | #include "user_module.inc" 2 | -------------------------------------------------------------------------------- /modules/boron/makefile: -------------------------------------------------------------------------------- 1 | include modular.mk 2 | 3 | %: 4 | $(MAKE) -C .. $(MAKECMDGOALS) 5 | -------------------------------------------------------------------------------- /modules/boron/system-part1/build.mk: -------------------------------------------------------------------------------- 1 | 2 | include ../../shared/nRF52840/part1_build.mk -------------------------------------------------------------------------------- /modules/boron/system-part1/import.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/system_module_version.mk 2 | SYSTEM_PART1_MODULE_PATH ?= $(PROJECT_ROOT)/modules/boron/system-part1 3 | 4 | ifeq ($(MINIMAL),y) 5 | GLOBAL_DEFINES += SYSTEM_MINIMAL 6 | endif 7 | 8 | include $(call rwildcard,$(SYSTEM_PART1_MODULE_PATH)/,include.mk) 9 | include $(call rwildcard,$(SHARED_MODULAR)/,include.mk) 10 | -------------------------------------------------------------------------------- /modules/boron/system-part1/src/export_rt.c: -------------------------------------------------------------------------------- 1 | #include "export_rt.inc" 2 | -------------------------------------------------------------------------------- /modules/boron/system-part1/src/export_system.cpp: -------------------------------------------------------------------------------- 1 | #include "export_system.inc" 2 | -------------------------------------------------------------------------------- /modules/boron/system-part1/src/import_user.c: -------------------------------------------------------------------------------- 1 | #include "import_user.inc" 2 | -------------------------------------------------------------------------------- /modules/boron/system-part1/src/import_user_compat.c: -------------------------------------------------------------------------------- 1 | #include "import_user_compat.inc" 2 | -------------------------------------------------------------------------------- /modules/boron/system-part1/src/module_info.c: -------------------------------------------------------------------------------- 1 | #include "module_info.inc" 2 | -------------------------------------------------------------------------------- /modules/boron/system-part1/src/module_system_part1.cpp: -------------------------------------------------------------------------------- 1 | #include "module_system_part1.inc" 2 | -------------------------------------------------------------------------------- /modules/boron/user-part/build.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/nRF52840/user_build.mk -------------------------------------------------------------------------------- /modules/boron/user-part/import.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/system_module_version.mk 2 | USER_PART_MODULE_PATH ?= $(PROJECT_ROOT)/modules/boron/user-part 3 | include $(call rwildcard,$(USER_PART_MODULE_PATH)/,include.mk) 4 | 5 | 6 | -------------------------------------------------------------------------------- /modules/boron/user-part/module_user_export.ld: -------------------------------------------------------------------------------- 1 | /* Dynalib table locations */ 2 | PROVIDE (link_dynalib_location_user = platform_user_part_dynalib_table_flash_start + 0); 3 | PROVIDE (link_dynalib_location_user_compat = platform_user_part_compat_dynalib_table_flash_start + 0 ); 4 | -------------------------------------------------------------------------------- /modules/boron/user-part/src/module_info.c: -------------------------------------------------------------------------------- 1 | #include "module_info.inc" 2 | -------------------------------------------------------------------------------- /modules/boron/user-part/src/newlib_stubs.cpp: -------------------------------------------------------------------------------- 1 | #include "newlib_stubs.inc" 2 | -------------------------------------------------------------------------------- /modules/boron/user-part/src/user_export.c: -------------------------------------------------------------------------------- 1 | #include "user_part_export.c" -------------------------------------------------------------------------------- /modules/boron/user-part/src/user_module.c: -------------------------------------------------------------------------------- 1 | #include "user_module.inc" 2 | -------------------------------------------------------------------------------- /modules/electron2/makefile: -------------------------------------------------------------------------------- 1 | include modular.mk 2 | 3 | %: 4 | $(MAKE) -C .. $(MAKECMDGOALS) 5 | -------------------------------------------------------------------------------- /modules/electron2/system-part1/build.mk: -------------------------------------------------------------------------------- 1 | 2 | include ../../shared/nRF52840/part1_build.mk -------------------------------------------------------------------------------- /modules/electron2/system-part1/import.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/system_module_version.mk 2 | SYSTEM_PART1_MODULE_PATH ?= $(PROJECT_ROOT)/modules/electron2/system-part1 3 | 4 | ifeq ($(MINIMAL),y) 5 | GLOBAL_DEFINES += SYSTEM_MINIMAL 6 | endif 7 | 8 | include $(call rwildcard,$(SYSTEM_PART1_MODULE_PATH)/,include.mk) 9 | include $(call rwildcard,$(SHARED_MODULAR)/,include.mk) 10 | -------------------------------------------------------------------------------- /modules/electron2/system-part1/src/export_rt.c: -------------------------------------------------------------------------------- 1 | #include "export_rt.inc" 2 | -------------------------------------------------------------------------------- /modules/electron2/system-part1/src/export_system.cpp: -------------------------------------------------------------------------------- 1 | #include "export_system.inc" 2 | -------------------------------------------------------------------------------- /modules/electron2/system-part1/src/import_user.c: -------------------------------------------------------------------------------- 1 | #include "import_user.inc" 2 | -------------------------------------------------------------------------------- /modules/electron2/system-part1/src/import_user_compat.c: -------------------------------------------------------------------------------- 1 | #include "import_user_compat.inc" 2 | -------------------------------------------------------------------------------- /modules/electron2/system-part1/src/module_info.c: -------------------------------------------------------------------------------- 1 | #include "module_info.inc" 2 | -------------------------------------------------------------------------------- /modules/electron2/system-part1/src/module_system_part1.cpp: -------------------------------------------------------------------------------- 1 | #include "module_system_part1.inc" 2 | -------------------------------------------------------------------------------- /modules/electron2/user-part/build.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/nRF52840/user_build.mk -------------------------------------------------------------------------------- /modules/electron2/user-part/import.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/system_module_version.mk 2 | USER_PART_MODULE_PATH ?= $(PROJECT_ROOT)/modules/electron2/user-part 3 | include $(call rwildcard,$(USER_PART_MODULE_PATH)/,include.mk) 4 | 5 | 6 | -------------------------------------------------------------------------------- /modules/electron2/user-part/module_user_export.ld: -------------------------------------------------------------------------------- 1 | /* Dynalib table locations */ 2 | PROVIDE (link_dynalib_location_user = platform_user_part_dynalib_table_flash_start + 0); 3 | PROVIDE (link_dynalib_location_user_compat = platform_user_part_compat_dynalib_table_flash_start + 0 ); 4 | -------------------------------------------------------------------------------- /modules/electron2/user-part/src/module_info.c: -------------------------------------------------------------------------------- 1 | #include "module_info.inc" 2 | -------------------------------------------------------------------------------- /modules/electron2/user-part/src/newlib_stubs.cpp: -------------------------------------------------------------------------------- 1 | #include "newlib_stubs.inc" 2 | -------------------------------------------------------------------------------- /modules/electron2/user-part/src/user_export.c: -------------------------------------------------------------------------------- 1 | #include "user_part_export.c" -------------------------------------------------------------------------------- /modules/electron2/user-part/src/user_module.c: -------------------------------------------------------------------------------- 1 | #include "user_module.inc" 2 | -------------------------------------------------------------------------------- /modules/msom/makefile: -------------------------------------------------------------------------------- 1 | include modular.mk 2 | 3 | %: 4 | $(MAKE) -C .. $(MAKECMDGOALS) 5 | -------------------------------------------------------------------------------- /modules/msom/modular.mk: -------------------------------------------------------------------------------- 1 | # Makefile that included by all modules - this defines the layout of the various modules 2 | 3 | SHARED_MODULAR=$(PROJECT_ROOT)/modules/shared/rtl872x 4 | 5 | MODULAR_FIRMWARE=y 6 | # propagate to sub makes 7 | MAKE_ARGS += MODULAR_FIRMWARE=y 8 | 9 | # Ensure these defines are passed to all sub makefiles 10 | GLOBAL_DEFINES += MODULAR_FIRMWARE=1 11 | 12 | export PLATFORM_ID ?= 35 -------------------------------------------------------------------------------- /modules/msom/system-part1/build.mk: -------------------------------------------------------------------------------- 1 | 2 | include ../../shared/rtl872x/part1_build.mk -------------------------------------------------------------------------------- /modules/msom/system-part1/import.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/system_module_version.mk 2 | SYSTEM_PART1_MODULE_PATH ?= $(PROJECT_ROOT)/modules/msom/system-part1 3 | 4 | ifeq ($(MINIMAL),y) 5 | GLOBAL_DEFINES += SYSTEM_MINIMAL 6 | endif 7 | 8 | include $(call rwildcard,$(SYSTEM_PART1_MODULE_PATH)/,include.mk) 9 | include $(call rwildcard,$(SHARED_MODULAR)/,include.mk) 10 | -------------------------------------------------------------------------------- /modules/msom/system-part1/src/export_rt.c: -------------------------------------------------------------------------------- 1 | #include "export_rt.inc" 2 | -------------------------------------------------------------------------------- /modules/msom/system-part1/src/export_system.cpp: -------------------------------------------------------------------------------- 1 | #include "export_system.inc" 2 | -------------------------------------------------------------------------------- /modules/msom/system-part1/src/import_user.c: -------------------------------------------------------------------------------- 1 | #include "import_user.inc" 2 | -------------------------------------------------------------------------------- /modules/msom/system-part1/src/import_user_preinit.c: -------------------------------------------------------------------------------- 1 | #include "import_user_preinit.inc" 2 | -------------------------------------------------------------------------------- /modules/msom/system-part1/src/module_info.c: -------------------------------------------------------------------------------- 1 | #include "module_info.inc" 2 | -------------------------------------------------------------------------------- /modules/msom/system-part1/src/module_system_part1.cpp: -------------------------------------------------------------------------------- 1 | #include "module_system_part1.inc" 2 | -------------------------------------------------------------------------------- /modules/msom/user-part/build.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/rtl872x/user_build.mk -------------------------------------------------------------------------------- /modules/msom/user-part/import.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/system_module_version.mk 2 | USER_PART_MODULE_PATH ?= $(PROJECT_ROOT)/modules/msom/user-part 3 | include $(call rwildcard,$(USER_PART_MODULE_PATH)/,include.mk) 4 | 5 | 6 | -------------------------------------------------------------------------------- /modules/msom/user-part/module_user_export.ld: -------------------------------------------------------------------------------- 1 | /* Dynalib table locations */ 2 | PROVIDE (link_dynalib_location_offset_preinit = 0); 3 | PROVIDE (link_dynalib_location_offset_user = 4); 4 | -------------------------------------------------------------------------------- /modules/msom/user-part/src/module_info.c: -------------------------------------------------------------------------------- 1 | #include "module_info.inc" 2 | -------------------------------------------------------------------------------- /modules/msom/user-part/src/newlib_stubs.cpp: -------------------------------------------------------------------------------- 1 | #include "newlib_stubs.inc" 2 | -------------------------------------------------------------------------------- /modules/msom/user-part/src/user_export.c: -------------------------------------------------------------------------------- 1 | #include "user_part_export.c" -------------------------------------------------------------------------------- /modules/msom/user-part/src/user_module.c: -------------------------------------------------------------------------------- 1 | #include "user_module.inc" 2 | -------------------------------------------------------------------------------- /modules/shared/nRF52840/inc/system-part1/export_rt.inc: -------------------------------------------------------------------------------- 1 | #define DYNALIB_EXPORT 2 | 3 | #include // for malloc, free, realloc 4 | #include 5 | #include // for va_list 6 | #include "rt_dynalib.h" 7 | -------------------------------------------------------------------------------- /modules/shared/nRF52840/inc/system-part1/import_user.inc: -------------------------------------------------------------------------------- 1 | #define DYNALIB_IMPORT 2 | #include "user_dynalib.h" 3 | -------------------------------------------------------------------------------- /modules/shared/nRF52840/inc/system-part1/import_user_compat.inc: -------------------------------------------------------------------------------- 1 | #define DYNALIB_IMPORT 2 | #include "user_dynalib_compat.h" 3 | -------------------------------------------------------------------------------- /modules/shared/nRF52840/inc/user-part/user_export.inc: -------------------------------------------------------------------------------- 1 | #include "user_part_export.c" -------------------------------------------------------------------------------- /modules/shared/nRF52840/inc/user-part/user_module.inc: -------------------------------------------------------------------------------- 1 | /** 2 | * The user module export table 3 | */ 4 | 5 | #include "dynalib.h" 6 | 7 | DYNALIB_TABLE_EXTERN(user); 8 | 9 | /** 10 | * The module export table. This lists the addresses of individual library dynalib jump tables. 11 | */ 12 | __attribute__((externally_visible)) const void* const user_part_module[] = { 13 | DYNALIB_TABLE_NAME(user), 14 | }; 15 | 16 | -------------------------------------------------------------------------------- /modules/shared/nRF52840/include.mk: -------------------------------------------------------------------------------- 1 | 2 | INCLUDE_DIRS += $(SHARED_MODULAR)/inc 3 | 4 | LDFLAGS += -L$(COMMON_BUILD)/arm/linker/nrf52840 5 | -------------------------------------------------------------------------------- /modules/shared/rtl872x/inc/system-part1/export_rt.inc: -------------------------------------------------------------------------------- 1 | #define DYNALIB_EXPORT 2 | 3 | #include // for malloc, free, realloc 4 | #include 5 | #include // for va_list 6 | #include "rt_dynalib.h" 7 | -------------------------------------------------------------------------------- /modules/shared/rtl872x/inc/system-part1/import_user.inc: -------------------------------------------------------------------------------- 1 | #define DYNALIB_IMPORT 2 | #include "user_dynalib.h" 3 | -------------------------------------------------------------------------------- /modules/shared/rtl872x/inc/system-part1/import_user_preinit.inc: -------------------------------------------------------------------------------- 1 | #define DYNALIB_IMPORT 2 | #include "user_preinit_dynalib.h" 3 | -------------------------------------------------------------------------------- /modules/shared/rtl872x/inc/user-part/user_export.inc: -------------------------------------------------------------------------------- 1 | #include "user_part_export.c" -------------------------------------------------------------------------------- /modules/shared/rtl872x/inc/user-part/user_module.inc: -------------------------------------------------------------------------------- 1 | /** 2 | * The user module export table 3 | */ 4 | 5 | #include "dynalib.h" 6 | 7 | DYNALIB_TABLE_EXTERN(preinit); 8 | DYNALIB_TABLE_EXTERN(user); 9 | 10 | /** 11 | * The module export table. This lists the addresses of individual library dynalib jump tables. 12 | */ 13 | __attribute__((externally_visible)) const void* const user_part_module[] = { 14 | DYNALIB_TABLE_NAME(preinit), 15 | DYNALIB_TABLE_NAME(user), 16 | }; 17 | 18 | -------------------------------------------------------------------------------- /modules/shared/rtl872x/include.mk: -------------------------------------------------------------------------------- 1 | 2 | INCLUDE_DIRS += $(SHARED_MODULAR)/inc 3 | 4 | LDFLAGS += -L$(COMMON_BUILD)/arm/linker/rtl872x 5 | -------------------------------------------------------------------------------- /modules/tracker/makefile: -------------------------------------------------------------------------------- 1 | include modular.mk 2 | 3 | %: 4 | $(MAKE) -C .. $(MAKECMDGOALS) 5 | -------------------------------------------------------------------------------- /modules/tracker/system-part1/build.mk: -------------------------------------------------------------------------------- 1 | 2 | include ../../shared/nRF52840/part1_build.mk -------------------------------------------------------------------------------- /modules/tracker/system-part1/import.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/system_module_version.mk 2 | SYSTEM_PART1_MODULE_PATH ?= $(PROJECT_ROOT)/modules/tracker/system-part1 3 | 4 | ifeq ($(MINIMAL),y) 5 | GLOBAL_DEFINES += SYSTEM_MINIMAL 6 | endif 7 | 8 | include $(call rwildcard,$(SYSTEM_PART1_MODULE_PATH)/,include.mk) 9 | include $(call rwildcard,$(SHARED_MODULAR)/,include.mk) 10 | -------------------------------------------------------------------------------- /modules/tracker/system-part1/src/export_rt.c: -------------------------------------------------------------------------------- 1 | #include "export_rt.inc" 2 | -------------------------------------------------------------------------------- /modules/tracker/system-part1/src/export_system.cpp: -------------------------------------------------------------------------------- 1 | #include "export_system.inc" 2 | -------------------------------------------------------------------------------- /modules/tracker/system-part1/src/import_user.c: -------------------------------------------------------------------------------- 1 | #include "import_user.inc" 2 | -------------------------------------------------------------------------------- /modules/tracker/system-part1/src/import_user_compat.c: -------------------------------------------------------------------------------- 1 | #include "import_user_compat.inc" 2 | -------------------------------------------------------------------------------- /modules/tracker/system-part1/src/module_info.c: -------------------------------------------------------------------------------- 1 | #include "module_info.inc" 2 | -------------------------------------------------------------------------------- /modules/tracker/system-part1/src/module_system_part1.cpp: -------------------------------------------------------------------------------- 1 | #include "module_system_part1.inc" 2 | -------------------------------------------------------------------------------- /modules/tracker/user-part/build.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/nRF52840/user_build.mk -------------------------------------------------------------------------------- /modules/tracker/user-part/import.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/system_module_version.mk 2 | USER_PART_MODULE_PATH ?= $(PROJECT_ROOT)/modules/tracker/user-part 3 | include $(call rwildcard,$(USER_PART_MODULE_PATH)/,include.mk) 4 | 5 | 6 | -------------------------------------------------------------------------------- /modules/tracker/user-part/module_user_export.ld: -------------------------------------------------------------------------------- 1 | /* Dynalib table locations */ 2 | PROVIDE (link_dynalib_location_user = platform_user_part_dynalib_table_flash_start + 0); 3 | PROVIDE (link_dynalib_location_user_compat = platform_user_part_compat_dynalib_table_flash_start + 0 ); 4 | -------------------------------------------------------------------------------- /modules/tracker/user-part/src/module_info.c: -------------------------------------------------------------------------------- 1 | #include "module_info.inc" 2 | -------------------------------------------------------------------------------- /modules/tracker/user-part/src/newlib_stubs.cpp: -------------------------------------------------------------------------------- 1 | #include "newlib_stubs.inc" 2 | -------------------------------------------------------------------------------- /modules/tracker/user-part/src/user_export.c: -------------------------------------------------------------------------------- 1 | #include "user_part_export.c" -------------------------------------------------------------------------------- /modules/tracker/user-part/src/user_module.c: -------------------------------------------------------------------------------- 1 | #include "user_module.inc" 2 | -------------------------------------------------------------------------------- /modules/trackerm/makefile: -------------------------------------------------------------------------------- 1 | include modular.mk 2 | 3 | %: 4 | $(MAKE) -C .. $(MAKECMDGOALS) 5 | -------------------------------------------------------------------------------- /modules/trackerm/modular.mk: -------------------------------------------------------------------------------- 1 | # Makefile that included by all modules - this defines the layout of the various modules 2 | 3 | SHARED_MODULAR=$(PROJECT_ROOT)/modules/shared/rtl872x 4 | 5 | MODULAR_FIRMWARE=y 6 | # propagate to sub makes 7 | MAKE_ARGS += MODULAR_FIRMWARE=y 8 | 9 | # Ensure these defines are passed to all sub makefiles 10 | GLOBAL_DEFINES += MODULAR_FIRMWARE=1 11 | 12 | export PLATFORM_ID ?= 28 -------------------------------------------------------------------------------- /modules/trackerm/system-part1/build.mk: -------------------------------------------------------------------------------- 1 | 2 | include ../../shared/rtl872x/part1_build.mk -------------------------------------------------------------------------------- /modules/trackerm/system-part1/import.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/system_module_version.mk 2 | SYSTEM_PART1_MODULE_PATH ?= $(PROJECT_ROOT)/modules/trackerm/system-part1 3 | 4 | ifeq ($(MINIMAL),y) 5 | GLOBAL_DEFINES += SYSTEM_MINIMAL 6 | endif 7 | 8 | include $(call rwildcard,$(SYSTEM_PART1_MODULE_PATH)/,include.mk) 9 | include $(call rwildcard,$(SHARED_MODULAR)/,include.mk) 10 | -------------------------------------------------------------------------------- /modules/trackerm/system-part1/src/export_rt.c: -------------------------------------------------------------------------------- 1 | #include "export_rt.inc" 2 | -------------------------------------------------------------------------------- /modules/trackerm/system-part1/src/export_system.cpp: -------------------------------------------------------------------------------- 1 | #include "export_system.inc" 2 | -------------------------------------------------------------------------------- /modules/trackerm/system-part1/src/import_user.c: -------------------------------------------------------------------------------- 1 | #include "import_user.inc" 2 | -------------------------------------------------------------------------------- /modules/trackerm/system-part1/src/import_user_preinit.c: -------------------------------------------------------------------------------- 1 | #include "import_user_preinit.inc" 2 | -------------------------------------------------------------------------------- /modules/trackerm/system-part1/src/module_info.c: -------------------------------------------------------------------------------- 1 | #include "module_info.inc" 2 | -------------------------------------------------------------------------------- /modules/trackerm/system-part1/src/module_system_part1.cpp: -------------------------------------------------------------------------------- 1 | #include "module_system_part1.inc" 2 | -------------------------------------------------------------------------------- /modules/trackerm/user-part/build.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/rtl872x/user_build.mk -------------------------------------------------------------------------------- /modules/trackerm/user-part/import.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/system_module_version.mk 2 | USER_PART_MODULE_PATH ?= $(PROJECT_ROOT)/modules/trackerm/user-part 3 | include $(call rwildcard,$(USER_PART_MODULE_PATH)/,include.mk) 4 | 5 | 6 | -------------------------------------------------------------------------------- /modules/trackerm/user-part/module_user_export.ld: -------------------------------------------------------------------------------- 1 | /* Dynalib table locations */ 2 | PROVIDE (link_dynalib_location_offset_preinit = 0); 3 | PROVIDE (link_dynalib_location_offset_user = 4); 4 | -------------------------------------------------------------------------------- /modules/trackerm/user-part/src/module_info.c: -------------------------------------------------------------------------------- 1 | #include "module_info.inc" 2 | -------------------------------------------------------------------------------- /modules/trackerm/user-part/src/newlib_stubs.cpp: -------------------------------------------------------------------------------- 1 | #include "newlib_stubs.inc" 2 | -------------------------------------------------------------------------------- /modules/trackerm/user-part/src/user_export.c: -------------------------------------------------------------------------------- 1 | #include "user_part_export.c" -------------------------------------------------------------------------------- /modules/trackerm/user-part/src/user_module.c: -------------------------------------------------------------------------------- 1 | #include "user_module.inc" 2 | -------------------------------------------------------------------------------- /modules/tron/makefile: -------------------------------------------------------------------------------- 1 | include modular.mk 2 | 3 | %: 4 | $(MAKE) -C .. $(MAKECMDGOALS) 5 | -------------------------------------------------------------------------------- /modules/tron/modular.mk: -------------------------------------------------------------------------------- 1 | # Makefile that included by all modules - this defines the layout of the various modules 2 | 3 | SHARED_MODULAR=$(PROJECT_ROOT)/modules/shared/rtl872x 4 | 5 | MODULAR_FIRMWARE=y 6 | # propagate to sub makes 7 | MAKE_ARGS += MODULAR_FIRMWARE=y 8 | 9 | # Ensure these defines are passed to all sub makefiles 10 | GLOBAL_DEFINES += MODULAR_FIRMWARE=1 11 | 12 | export PLATFORM_ID ?= 32 -------------------------------------------------------------------------------- /modules/tron/system-part1/build.mk: -------------------------------------------------------------------------------- 1 | 2 | include ../../shared/rtl872x/part1_build.mk -------------------------------------------------------------------------------- /modules/tron/system-part1/import.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/system_module_version.mk 2 | SYSTEM_PART1_MODULE_PATH ?= $(PROJECT_ROOT)/modules/tron/system-part1 3 | 4 | ifeq ($(MINIMAL),y) 5 | GLOBAL_DEFINES += SYSTEM_MINIMAL 6 | endif 7 | 8 | include $(call rwildcard,$(SYSTEM_PART1_MODULE_PATH)/,include.mk) 9 | include $(call rwildcard,$(SHARED_MODULAR)/,include.mk) 10 | -------------------------------------------------------------------------------- /modules/tron/system-part1/src/export_rt.c: -------------------------------------------------------------------------------- 1 | #include "export_rt.inc" 2 | -------------------------------------------------------------------------------- /modules/tron/system-part1/src/export_system.cpp: -------------------------------------------------------------------------------- 1 | #include "export_system.inc" 2 | -------------------------------------------------------------------------------- /modules/tron/system-part1/src/import_user.c: -------------------------------------------------------------------------------- 1 | #include "import_user.inc" 2 | -------------------------------------------------------------------------------- /modules/tron/system-part1/src/import_user_preinit.c: -------------------------------------------------------------------------------- 1 | #include "import_user_preinit.inc" 2 | -------------------------------------------------------------------------------- /modules/tron/system-part1/src/module_info.c: -------------------------------------------------------------------------------- 1 | #include "module_info.inc" 2 | -------------------------------------------------------------------------------- /modules/tron/system-part1/src/module_system_part1.cpp: -------------------------------------------------------------------------------- 1 | #include "module_system_part1.inc" 2 | -------------------------------------------------------------------------------- /modules/tron/user-part/build.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/rtl872x/user_build.mk -------------------------------------------------------------------------------- /modules/tron/user-part/import.mk: -------------------------------------------------------------------------------- 1 | include ../../shared/system_module_version.mk 2 | USER_PART_MODULE_PATH ?= $(PROJECT_ROOT)/modules/tron/user-part 3 | include $(call rwildcard,$(USER_PART_MODULE_PATH)/,include.mk) 4 | 5 | 6 | -------------------------------------------------------------------------------- /modules/tron/user-part/module_user_export.ld: -------------------------------------------------------------------------------- 1 | /* Dynalib table locations */ 2 | PROVIDE (link_dynalib_location_offset_preinit = 0); 3 | PROVIDE (link_dynalib_location_offset_user = 4); 4 | -------------------------------------------------------------------------------- /modules/tron/user-part/src/module_info.c: -------------------------------------------------------------------------------- 1 | #include "module_info.inc" 2 | -------------------------------------------------------------------------------- /modules/tron/user-part/src/newlib_stubs.cpp: -------------------------------------------------------------------------------- 1 | #include "newlib_stubs.inc" 2 | -------------------------------------------------------------------------------- /modules/tron/user-part/src/user_export.c: -------------------------------------------------------------------------------- 1 | #include "user_part_export.c" -------------------------------------------------------------------------------- /modules/tron/user-part/src/user_module.c: -------------------------------------------------------------------------------- 1 | #include "user_module.inc" 2 | -------------------------------------------------------------------------------- /newlib_nano/build.mk: -------------------------------------------------------------------------------- 1 | 2 | include $(NEWLIBNANO_MODULE_PATH)/src/sources.mk 3 | 4 | CFLAGS += -DHAVE_MMAP=0 5 | ifneq ("$(PLATFORM_ID)","3") 6 | CFLAGS += -Wno-unused-but-set-variable 7 | CFLAGS += -Wno-unused-variable 8 | endif 9 | 10 | -------------------------------------------------------------------------------- /newlib_nano/makefile: -------------------------------------------------------------------------------- 1 | 2 | MODULE=newlib_nano 3 | NEWLIBNANO_MODULE_PATH=. 4 | 5 | # Target this makefile is building. 6 | TARGET_TYPE = a 7 | BUILD_PATH_EXT = $(NEWLIBNANO_BUILD_PATH_EXT) 8 | 9 | DEPENDENCIES = hal services platform dynalib 10 | 11 | include ../build/arm-tlm.mk 12 | -------------------------------------------------------------------------------- /newlib_nano/src/custom-nano-4.8.4.specs: -------------------------------------------------------------------------------- 1 | *link: 2 | %(nano_link) %:replace-outfile(-lc -lc_s) %:replace-outfile(-lg -lnewlib_nano) %:replace-outfile(-lrdimon -lrdimon_s) %:replace-outfile(-lstdc++ -lstdc++_s) %:replace-outfile(-lsupc++ -lsupc++_s) 3 | 4 | *lib: 5 | -lnewlib_nano %{!shared:%{g*:-lg_s} %{!p:%{!pg:-lc_s}}%{p:-lc_p}%{pg:-lc_p}} 6 | 7 | -------------------------------------------------------------------------------- /newlib_nano/src/custom-nano.specs: -------------------------------------------------------------------------------- 1 | *link: 2 | %(nano_link) %:replace-outfile(-lc -lc_nano) %:replace-outfile(-lg -lnewlib_nano) %:replace-outfile(-lrdimon -lrdimon_nano) %:replace-outfile(-lstdc++ -lstdc++_nano) %:replace-outfile(-lsupc++ -lsupc++_nano) 3 | 4 | *lib: 5 | -lnewlib_nano %{!shared:%{g*:-lg_nano} %{!p:%{!pg:-lc_nano}}%{p:-lc_p}%{pg:-lc_p}} 6 | 7 | -------------------------------------------------------------------------------- /newlib_nano/src/sources.mk: -------------------------------------------------------------------------------- 1 | NEWLIBNANO_SRC_COMMON_PATH = $(NEWLIBNANO_MODULE_PATH)/src 2 | 3 | # Use FreeRTOS heap_4 and a set of newlib wrappers 4 | CPPSRC += $(NEWLIBNANO_SRC_COMMON_PATH)/malloc.cpp 5 | -------------------------------------------------------------------------------- /platform/MCU/build.mk: -------------------------------------------------------------------------------- 1 | # all build.mk files are loaded recursively 2 | # This project has these build.mk files which act as "gatekeepers" only 3 | # pulling in the required sources. 4 | # (Include files are selected in import.mk) 5 | 6 | PLATFORM_MCU_PATH = $(PLATFORM_MODULE_PATH)/MCU/$(PLATFORM_MCU) 7 | include $(call rwildcard,$(PLATFORM_MCU_PATH)/,sources.mk) 8 | -------------------------------------------------------------------------------- /platform/MCU/gcc/inc/hw_config.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot/device-os/99fd93b8965da95c112c6afb4058427109b1ad57/platform/MCU/gcc/inc/hw_config.h -------------------------------------------------------------------------------- /platform/MCU/gcc/inc/include.mk: -------------------------------------------------------------------------------- 1 | 2 | TARGET_GCC_MCU_INC = $(PLATFORM_MCU_PATH)/inc 3 | INCLUDE_DIRS += $(TARGET_GCC_MCU_INC) 4 | -------------------------------------------------------------------------------- /platform/MCU/gcc/include.mk: -------------------------------------------------------------------------------- 1 | PLATFORM_DEPS = third_party/littlefs 2 | PLATFORM_DEPS_INCLUDE_SCRIPTS =$(foreach module,$(PLATFORM_DEPS),$(PROJECT_ROOT)/$(module)/import.mk) 3 | include $(PLATFORM_DEPS_INCLUDE_SCRIPTS) 4 | 5 | PLATFORM_LIB_DEP += $(LITTLEFS_LIB_DEP) 6 | LIBS += $(notdir $(PLATFORM_DEPS)) 7 | LIB_DIRS += $(LITTLEFS_LIB_DIR) 8 | -------------------------------------------------------------------------------- /platform/MCU/gcc/src/hw_config.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | // just a single symbol so that the platform library is not empty 4 | void hw_config_temp() 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /platform/MCU/gcc/src/sources.mk: -------------------------------------------------------------------------------- 1 | # This file is a makefile included from the top level makefile which 2 | # defines the sources built for the target. 3 | 4 | # Define the prefix to this directory. 5 | # Note: The name must be unique within this build and should be 6 | # based on the root of the project 7 | TARGET_GCC_MCU_SRC = $(PLATFORM_MCU_PATH)/src 8 | 9 | CSRC += $(TARGET_GCC_MCU_SRC)/hw_config.c 10 | 11 | # C++ source files included in this build. 12 | CPPSRC += 13 | 14 | # ASM source files included in this build. 15 | ASRC += 16 | 17 | 18 | -------------------------------------------------------------------------------- /platform/MCU/gcc/tlm.mk: -------------------------------------------------------------------------------- 1 | # Inject dependencies 2 | DEPENDENCIES += third_party/littlefs 3 | MAKE_DEPENDENCIES += third_party/littlefs 4 | -------------------------------------------------------------------------------- /platform/MCU/nRF52840/inc/include.mk: -------------------------------------------------------------------------------- 1 | 2 | TARGET_NEW_HAL_MCU_INC = $(PLATFORM_MCU_PATH)/inc 3 | INCLUDE_DIRS += $(TARGET_NEW_HAL_MCU_INC) 4 | -------------------------------------------------------------------------------- /platform/MCU/nRF52840/inc/legacy/apply_old_config.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot/device-os/99fd93b8965da95c112c6afb4058427109b1ad57/platform/MCU/nRF52840/inc/legacy/apply_old_config.h -------------------------------------------------------------------------------- /platform/MCU/nRF52840/inc/nrfx_types.h: -------------------------------------------------------------------------------- 1 | #ifndef NRFX_TYPES_H__ 2 | #define NRFX_TYPES_H__ 3 | 4 | typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState; 5 | #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE)) 6 | 7 | #endif // NRFX_TYPES_H__ 8 | -------------------------------------------------------------------------------- /platform/MCU/nRF52840/include.mk: -------------------------------------------------------------------------------- 1 | PLATFORM_DEPS = third_party/nrf5_sdk third_party/littlefs third_party/miniz 2 | PLATFORM_DEPS_INCLUDE_SCRIPTS =$(foreach module,$(PLATFORM_DEPS),$(PROJECT_ROOT)/$(module)/import.mk) 3 | include $(PLATFORM_DEPS_INCLUDE_SCRIPTS) 4 | 5 | PLATFORM_LIB_DEP += $(NRF5_SDK_LIB_DEP) $(LITTLEFS_LIB_DEP) $(MINIZ_LIB_DEP) 6 | LIBS += $(notdir $(PLATFORM_DEPS)) 7 | LIB_DIRS += $(NRF5_SDK_LIB_DIR) $(LITTLEFS_LIB_DIR) $(MINIZ_LIB_DIR) 8 | -------------------------------------------------------------------------------- /platform/MCU/nRF52840/tlm.mk: -------------------------------------------------------------------------------- 1 | # Inject dependencies 2 | DEPENDENCIES += third_party/nrf5_sdk third_party/littlefs third_party/miniz 3 | MAKE_DEPENDENCIES += third_party/nrf5_sdk third_party/littlefs third_party/miniz 4 | -------------------------------------------------------------------------------- /platform/MCU/newhal-mcu/inc/flash_mal.h: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /platform/MCU/newhal-mcu/inc/include.mk: -------------------------------------------------------------------------------- 1 | 2 | TARGET_NEW_HAL_MCU_INC = $(PLATFORM_MCU_PATH)/inc 3 | INCLUDE_DIRS += $(TARGET_NEW_HAL_MCU_INC) 4 | -------------------------------------------------------------------------------- /platform/MCU/newhal-mcu/include.mk: -------------------------------------------------------------------------------- 1 | PLATFORM_DEPS = third_party/littlefs 2 | PLATFORM_DEPS_INCLUDE_SCRIPTS =$(foreach module,$(PLATFORM_DEPS),$(PROJECT_ROOT)/$(module)/import.mk) 3 | include $(PLATFORM_DEPS_INCLUDE_SCRIPTS) 4 | 5 | PLATFORM_LIB_DEP += $(LITTLEFS_LIB_DEP) 6 | LIBS += $(notdir $(PLATFORM_DEPS)) 7 | LIB_DIRS += $(LITTLEFS_LIB_DIR) 8 | -------------------------------------------------------------------------------- /platform/MCU/newhal-mcu/src/hw_config.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | uint8_t USE_SYSTEM_FLAGS; 4 | uint16_t tempFlag; 5 | -------------------------------------------------------------------------------- /platform/MCU/newhal-mcu/src/sources.mk: -------------------------------------------------------------------------------- 1 | # This file is a makefile included from the top level makefile which 2 | # defines the sources built for the target. 3 | 4 | # Define the prefix to this directory. 5 | # Note: The name must be unique within this build and should be 6 | # based on the root of the project 7 | TARGET_NEW_HAL_MCU_SRC = $(PLATFORM_MCU_PATH)/src 8 | 9 | CSRC += $(TARGET_NEW_HAL_MCU_SRC)/hw_config.c 10 | 11 | # C++ source files included in this build. 12 | CPPSRC += 13 | 14 | # ASM source files included in this build. 15 | ASRC += 16 | 17 | 18 | -------------------------------------------------------------------------------- /platform/MCU/newhal-mcu/tlm.mk: -------------------------------------------------------------------------------- 1 | # Inject dependencies 2 | DEPENDENCIES += third_party/littlefs 3 | MAKE_DEPENDENCIES += third_party/littlefs 4 | -------------------------------------------------------------------------------- /platform/MCU/rtl872x/inc/build_info.h: -------------------------------------------------------------------------------- 1 | #define UTS_VERSION "2020/03/05-20:32:05" 2 | #define RTL_FW_COMPILE_TIME "2020/03/05-20:32:05" 3 | #define RTL_FW_COMPILE_DATE "2020/03/05" 4 | #define RTL_FW_COMPILE_BY "derek1_zhang" 5 | #define RTL_FW_COMPILE_HOST "E52860512" 6 | #define RTL_FW_COMPILE_DOMAIN 7 | #define RTL_FW_COMPILER "IAR compiler" 8 | -------------------------------------------------------------------------------- /platform/MCU/rtl872x/inc/include.mk: -------------------------------------------------------------------------------- 1 | 2 | TARGET_NEW_HAL_MCU_INC = $(PLATFORM_MCU_PATH)/inc 3 | INCLUDE_DIRS += $(TARGET_NEW_HAL_MCU_INC) 4 | -------------------------------------------------------------------------------- /platform/MCU/rtl872x/inc/platform_opts_bt.h: -------------------------------------------------------------------------------- 1 | #ifndef __PLATFORM_OPTS_BT_H__ 2 | #define __PLATFORM_OPTS_BT_H__ 3 | #include "platform_autoconf.h" 4 | 5 | #if defined CONFIG_BT && CONFIG_BT 6 | #define CONFIG_FTL_ENABLED 7 | #endif 8 | 9 | #if defined CONFIG_BT_SCATTERNET && CONFIG_BT_SCATTERNET 10 | #define CONFIG_BT_PERIPHERAL 1 11 | #define CONFIG_BT_CENTRAL 1 12 | #endif 13 | 14 | #if defined CONFIG_BT_CENTRAL && CONFIG_BT_CENTRAL 15 | #define CONFIG_BT_USER_COMMAND 0 16 | #endif 17 | 18 | #endif // __PLATFORM_OPTS_BT_H__ 19 | 20 | -------------------------------------------------------------------------------- /platform/MCU/rtl872x/inc/xmodem_update_rom.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot/device-os/99fd93b8965da95c112c6afb4058427109b1ad57/platform/MCU/rtl872x/inc/xmodem_update_rom.h -------------------------------------------------------------------------------- /platform/MCU/rtl872x/src/hw_system_flags.c: -------------------------------------------------------------------------------- 1 | 2 | #include "hw_system_flags.h" 3 | #include "hw_config.h" 4 | 5 | void Save_Reset_Syndrome() 6 | { 7 | } 8 | 9 | uint8_t RCC_GetFlagStatus(uint8_t flag) 10 | { 11 | return RESET; 12 | } 13 | 14 | void RCC_ClearFlag(void) 15 | { 16 | } 17 | -------------------------------------------------------------------------------- /platform/MCU/rtl872x/tlm.mk: -------------------------------------------------------------------------------- 1 | # Inject dependencies 2 | DEPENDENCIES += third_party/ambd_sdk 3 | MAKE_DEPENDENCIES += third_party/ambd_sdk 4 | 5 | ifneq ("$(ARM_CPU)","cortex-m23") 6 | DEPENDENCIES += third_party/littlefs third_party/miniz 7 | MAKE_DEPENDENCIES += third_party/littlefs third_party/miniz 8 | endif 9 | -------------------------------------------------------------------------------- /platform/NET/build.mk: -------------------------------------------------------------------------------- 1 | # all build.mk files are loaded recursively 2 | # This project has these build.mk files one level down which act as "gatekeepers" only 3 | # pulling in the required sources. 4 | # (Include files are selected in import.mk) 5 | 6 | PLATFORM_NET_PATH = $(PLATFORM_MODULE_PATH)/NET/$(PLATFORM_NET) 7 | include $(call rwildcard,$(PLATFORM_NET_PATH)/,sources.mk) 8 | -------------------------------------------------------------------------------- /platform/makefile: -------------------------------------------------------------------------------- 1 | 2 | MODULE=platform 3 | PLATFORM_MODULE_PATH=. 4 | 5 | # Target this makefile is building. 6 | TARGET_TYPE = a 7 | BUILD_PATH_EXT = $(PLATFORM_BUILD_PATH_EXT) 8 | 9 | DEPENDENCIES = services hal dynalib 10 | 11 | # ensure PLATFORM_MCU is defined 12 | include ../build/platform-id.mk 13 | 14 | PLATFORM_MCU_PATH ?= $(PLATFORM_MODULE_PATH)/MCU/$(PLATFORM_MCU) 15 | -include $(PLATFORM_MCU_PATH)/tlm.mk 16 | 17 | include ../build/arm-tlm.mk 18 | -------------------------------------------------------------------------------- /proto_defs/.gitignore: -------------------------------------------------------------------------------- 1 | /.venv/ 2 | -------------------------------------------------------------------------------- /proto_defs/build.mk: -------------------------------------------------------------------------------- 1 | CPPSRC += $(call target_files,$(PROTO_DEFS_MODULE_PATH)/src,*.cpp) 2 | CSRC += $(call target_files,$(PROTO_DEFS_MODULE_PATH)/src,*.c) 3 | -------------------------------------------------------------------------------- /proto_defs/import.mk: -------------------------------------------------------------------------------- 1 | PROTO_DEFS_MODULE_NAME = proto_defs 2 | PROTO_DEFS_MODULE_PATH ?= $(PROJECT_ROOT)/$(PROTO_DEFS_MODULE_NAME) 3 | include $(call rwildcard,$(PROTO_DEFS_MODULE_PATH)/,include.mk) 4 | 5 | PROTO_DEFS_BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM) 6 | PROTO_DEFS_LIB_DIR = $(BUILD_PATH_BASE)/$(PROTO_DEFS_MODULE_NAME)/$(PROTO_DEFS_BUILD_PATH_EXT) 7 | PROTO_DEFS_LIB_DEP = $(PROTO_DEFS_LIB_DIR)/lib$(PROTO_DEFS_MODULE_NAME).a 8 | -------------------------------------------------------------------------------- /proto_defs/include.mk: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRS += $(PROTO_DEFS_MODULE_PATH)/src 2 | -------------------------------------------------------------------------------- /proto_defs/makefile: -------------------------------------------------------------------------------- 1 | MODULE = proto_defs 2 | PROTO_DEFS_MODULE_PATH = . 3 | 4 | # Target this makefile is building. 5 | TARGET_TYPE = a 6 | 7 | BUILD_PATH_EXT = $(PROTO_DEFS_BUILD_PATH_EXT) 8 | 9 | DEPENDENCIES = third_party/nanopb 10 | MAKE_DEPENDENCIES = third_party/nanopb 11 | 12 | include ../build/arm-tlm.mk 13 | -------------------------------------------------------------------------------- /proto_defs/src/control/extensions.pb.c: -------------------------------------------------------------------------------- 1 | /* Automatically generated nanopb constant definitions */ 2 | /* Generated by nanopb-0.4.5 */ 3 | 4 | #include "control/extensions.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 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /proto_defs/src/ledger.pb.c: -------------------------------------------------------------------------------- 1 | /* Automatically generated nanopb constant definitions */ 2 | /* Generated by nanopb-0.4.5 */ 3 | 4 | #include "ledger.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(particle_firmware_LedgerInfo, particle_firmware_LedgerInfo, AUTO) 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /rt-dynalib/import.mk: -------------------------------------------------------------------------------- 1 | RT_DYNALIB_MODULE_NAME = rt-dynalib 2 | RT_DYNALIB_MODULE_PATH ?= $(PROJECT_ROOT)/$(RT_DYNALIB_MODULE_NAME) 3 | include $(call rwildcard,$(RT_DYNALIB_MODULE_PATH)/,include.mk) 4 | 5 | RT_DYNALIB_BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM) 6 | RT_DYNALIB_LIB_DIR = $(BUILD_PATH_BASE)/$(RT_DYNALIB_MODULE_NAME)/$(RT_DYNALIB_BUILD_PATH_EXT) 7 | RT_DYNALIB_LIB_DEP = $(RT_DYNALIB_LIB_DIR)/lib$(RT_DYNALIB_MODULE_NAME).a 8 | 9 | INCLUDE_DIRS += $(RT_DYNALIB_MODULE_PATH)/inc 10 | 11 | # have to disable malloc/free builtins 12 | CFLAGS += -fno-builtin 13 | 14 | -------------------------------------------------------------------------------- /rt-dynalib/makefile: -------------------------------------------------------------------------------- 1 | 2 | MODULE=rt-dynalib 3 | RT_DYNALIB_MODULE_PATH=. 4 | 5 | # Target this makefile is building. 6 | TARGET_TYPE = a 7 | BUILD_PATH_EXT = $(RT_DYNALIB_BUILD_PATH_EXT) 8 | DEPENDENCIES = dynalib hal 9 | 10 | include ../build/arm-tlm.mk 11 | -------------------------------------------------------------------------------- /rt-dynalib/src/build.mk: -------------------------------------------------------------------------------- 1 | 2 | TARGET_RT_DYNALIB_SRC_PATH = $(RT_DYNALIB_MODULE_PATH)/src 3 | 4 | CPPSRC += $(call target_files,$(TARGET_RT_DYNALIB_SRC_PATH),*.cpp) 5 | CSRC += $(call target_files,$(TARGET_RT_DYNALIB_SRC_PATH),*.c) 6 | 7 | # gcc includes a number of C rt functions as builtins, which causes the 8 | # stubs to not compile since they have a different method signature to the already 9 | # declared builtin 10 | BUILTINS_EXCLUDE = malloc free 11 | 12 | CFLAGS += $(addprefix -fno-builtin-,$(BUILTINS_EXCLUDE)) 13 | -------------------------------------------------------------------------------- /rt-dynalib/src/rt_dynalib.c: -------------------------------------------------------------------------------- 1 | #define DYNALIB_IMPORT 2 | #include "rt_dynalib.h" 3 | -------------------------------------------------------------------------------- /scripts/docker-hub-login: -------------------------------------------------------------------------------- 1 | if [ ! -z "$DOCKER_HUB_USERNAME" ]; then docker login --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD; fi 2 | -------------------------------------------------------------------------------- /scripts/flash.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | OPENOCD=$(which openocd) 3 | $OPENOCD -f interface/cmsis-dap.cfg -c "transport select swd" \ 4 | -f $1 \ 5 | -c init -c "reset halt" \ 6 | -c "rtl872x_flash_write_bin $2 $3" \ 7 | -c "rtl872x_wdg_reset" \ 8 | -c shutdown 9 | -------------------------------------------------------------------------------- /scripts/target/rtl872x.tcl: -------------------------------------------------------------------------------- 1 | ../rtl872x.tcl -------------------------------------------------------------------------------- /services-dynalib/import.mk: -------------------------------------------------------------------------------- 1 | SERVICES_DYNALIB_MODULE_NAME = services-dynalib 2 | SERVICES_DYNALIB_MODULE_PATH ?= $(PROJECT_ROOT)/$(SERVICES_DYNALIB_MODULE_NAME) 3 | include $(call rwildcard,$(SERVICES_DYNALIB_MODULE_PATH)/,include.mk) 4 | 5 | SERVICES_DYNALIB_BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM) 6 | SERVICES_DYNALIB_LIB_DIR = $(BUILD_PATH_BASE)/$(SERVICES_DYNALIB_MODULE_NAME)/$(SERVICES_DYNALIB_BUILD_PATH_EXT) 7 | SERVICES_DYNALIB_LIB_DEP = $(SERVICES_DYNALIB_LIB_DIR)/lib$(SERVICES_DYNALIB_MODULE_NAME).a 8 | -------------------------------------------------------------------------------- /services-dynalib/makefile: -------------------------------------------------------------------------------- 1 | 2 | MODULE=services-dynalib 3 | SERVICES_DYNALIB_MODULE_PATH=. 4 | 5 | TARGET_TYPE = a 6 | BUILD_PATH_EXT = $(SERVICES_DYNALIB_BUILD_PATH_EXT) 7 | DEPENDENCIES = dynalib services 8 | 9 | include ../build/arm-tlm.mk 10 | -------------------------------------------------------------------------------- /services-dynalib/readme.md: -------------------------------------------------------------------------------- 1 | A dynamic-link implementation of the services module. 2 | -------------------------------------------------------------------------------- /services-dynalib/src/build.mk: -------------------------------------------------------------------------------- 1 | TARGET_SERVICES_DYNALIB_SRC_PATH = $(SERVICES_DYNALIB_MODULE_PATH)/src 2 | 3 | CPPSRC += $(call target_files,$(TARGET_SERVICES_DYNALIB_SRC_PATH),*.cpp) 4 | CSRC += $(call target_files,$(TARGET_SERVICES_DYNALIB_SRC_PATH),*.c) 5 | 6 | -------------------------------------------------------------------------------- /services-dynalib/src/services_dynalib.c: -------------------------------------------------------------------------------- 1 | 2 | #define DYNALIB_IMPORT 3 | 4 | #include "services_dynalib.h" 5 | -------------------------------------------------------------------------------- /services/import.mk: -------------------------------------------------------------------------------- 1 | SERVICES_MODULE_NAME = services 2 | SERVICES_MODULE_PATH ?= $(PROJECT_ROOT)/$(SERVICES_MODULE_NAME) 3 | include $(call rwildcard,$(SERVICES_MODULE_PATH)/,include.mk) 4 | 5 | SERVICES_BUILD_PATH_EXT=$(BUILD_TARGET_PLATFORM) 6 | SERVICES_LIB_DIR = $(BUILD_PATH_BASE)/$(SERVICES_MODULE_NAME)/$(SERVICES_BUILD_PATH_EXT) 7 | SERVICES_LIB_DEP = $(SERVICES_LIB_DIR)/lib$(SERVICES_MODULE_NAME).a 8 | -------------------------------------------------------------------------------- /services/inc/debug.h: -------------------------------------------------------------------------------- 1 | #include "service_debug.h" 2 | -------------------------------------------------------------------------------- /services/makefile: -------------------------------------------------------------------------------- 1 | 2 | MODULE=services 3 | SERVICES_MODULE_PATH=. 4 | 5 | # Target this makefile is building. 6 | TARGET_TYPE = a 7 | BUILD_PATH_EXT=$(SERVICES_BUILD_PATH_EXT) 8 | DEPENDENCIES = platform hal system wiring dynalib 9 | MAKE_DEPENDENCIES = 10 | 11 | include ../build/arm-tlm.mk 12 | -------------------------------------------------------------------------------- /services/readme.md: -------------------------------------------------------------------------------- 1 | This folder contains hardware-neutral services. 2 | -------------------------------------------------------------------------------- /services/src/build.mk: -------------------------------------------------------------------------------- 1 | 2 | TARGET_SPARK_SERVICES_SRC_PATH = $(SERVICES_MODULE_PATH)/src 3 | NANOPB_SRC_PATH = $(SERVICES_MODULE_PATH)/nanopb 4 | 5 | CPPSRC += $(call target_files,$(TARGET_SPARK_SERVICES_SRC_PATH),*.cpp) 6 | CSRC += $(call target_files,$(TARGET_SPARK_SERVICES_SRC_PATH),*.c) 7 | 8 | LOG_MODULE_CATEGORY = service 9 | -------------------------------------------------------------------------------- /system-dynalib/import.mk: -------------------------------------------------------------------------------- 1 | SYSTEM_DYNALIB_MODULE_NAME = system-dynalib 2 | SYSTEM_DYNALIB_MODULE_PATH ?= $(PROJECT_ROOT)/$(SYSTEM_DYNALIB_MODULE_NAME) 3 | include $(call rwildcard,$(SYSTEM_DYNALIB_MODULE_PATH)/,include.mk) 4 | SYSTEM_DYNALIB_BUILD_PATH_EXT=$(BUILD_TARGET_PLATFORM) 5 | SYSTEM_DYNALIB_LIB_DIR = $(BUILD_PATH_BASE)/system-dynalib/$(SYSTEM_DYNALIB_BUILD_PATH_EXT) 6 | SYSTEM_DYNALIB_LIB_DEP = $(SYSTEM_DYNALIB_LIB_DIR)/libsystem-dynalib.a 7 | -------------------------------------------------------------------------------- /system-dynalib/makefile: -------------------------------------------------------------------------------- 1 | 2 | MODULE=system-dynalib 3 | SYSTEM_DYNALIB_MODULE_PATH=. 4 | 5 | TARGET_TYPE = a 6 | BUILD_PATH_EXT = $(SYSTEM_DYNALIB_BUILD_PATH_EXT) 7 | DEPENDENCIES = system dynalib hal services 8 | 9 | include ../build/arm-tlm.mk 10 | -------------------------------------------------------------------------------- /system-dynalib/src/build.mk: -------------------------------------------------------------------------------- 1 | TARGET_SYSTEM_DYNALIB_SRC_PATH = $(SYSTEM_DYNALIB_MODULE_PATH)/src 2 | 3 | CPPSRC += $(call target_files,$(TARGET_SYSTEM_DYNALIB_SRC_PATH),*.cpp) 4 | CSRC += $(call target_files,$(TARGET_SYSTEM_DYNALIB_SRC_PATH),*.c) 5 | 6 | -------------------------------------------------------------------------------- /system-dynalib/src/system_dynalib.c: -------------------------------------------------------------------------------- 1 | #define DYNALIB_IMPORT 2 | #include "system_dynalib.h" 3 | -------------------------------------------------------------------------------- /system-dynalib/src/system_dynalib_asset_manager.c: -------------------------------------------------------------------------------- 1 | #define DYNALIB_IMPORT 2 | #include "system_dynalib_asset_manager.h" 3 | -------------------------------------------------------------------------------- /system-dynalib/src/system_dynalib_cloud.c: -------------------------------------------------------------------------------- 1 | #define DYNALIB_IMPORT 2 | #include "system_dynalib_cloud.h" 3 | -------------------------------------------------------------------------------- /system-dynalib/src/system_dynalib_ledger.c: -------------------------------------------------------------------------------- 1 | #define DYNALIB_IMPORT 2 | 3 | #include "system_dynalib_ledger.h" 4 | -------------------------------------------------------------------------------- /system-dynalib/src/system_dynalib_net.c: -------------------------------------------------------------------------------- 1 | #define DYNALIB_IMPORT 2 | #include "system_dynalib_net.h" 3 | -------------------------------------------------------------------------------- /system/import.mk: -------------------------------------------------------------------------------- 1 | SYSTEM_MODULE_NAME = system 2 | SYSTEM_MODULE_PATH ?= $(PROJECT_ROOT)/$(SYSTEM_MODULE_NAME) 3 | include $(call rwildcard,$(SYSTEM_MODULE_PATH)/,include.mk) 4 | 5 | SYSTEM_BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM) 6 | SYSTEM_LIB_DIR = $(BUILD_PATH_BASE)/$(SYSTEM_MODULE_NAME)/$(SYSTEM_BUILD_PATH_EXT) 7 | SYSTEM_LIB_DEP = $(SYSTEM_LIB_DIR)/lib$(SYSTEM_MODULE_NAME).a 8 | -------------------------------------------------------------------------------- /system/inc/include.mk: -------------------------------------------------------------------------------- 1 | 2 | # Add include to all objects built for this target 3 | INCLUDE_DIRS += $(SYSTEM_MODULE_PATH)/inc 4 | 5 | SYSTEM_DEPS = 6 | SYSTEM_DEPS_INCLUDE_SCRIPTS =$(foreach module,$(SYSTEM_DEPS),$(PROJECT_ROOT)/$(module)/import.mk) 7 | include $(SYSTEM_DEPS_INCLUDE_SCRIPTS) 8 | 9 | ifneq ($(filter system,$(LIBS)),) 10 | SYSTEM_LIB_DEP += 11 | LIBS += $(notdir $(SYSTEM_DEPS)) 12 | LIB_DIRS += 13 | endif 14 | -------------------------------------------------------------------------------- /system/makefile: -------------------------------------------------------------------------------- 1 | 2 | MODULE=system 3 | SYSTEM_MODULE_PATH=. 4 | BUILD_PATH_EXT = $(SYSTEM_BUILD_PATH_EXT) 5 | 6 | ifeq ("","$(SPARK_NO_PLATFORM)") 7 | DEPENDENCIES += platform 8 | CFLAGS += -DSPARK_PLATFORM 9 | endif 10 | DEPENDENCIES = platform hal services communication wiring dynalib crypto proto_defs 11 | TARGET_TYPE = a 12 | 13 | MAKE_DEPENDENCIES = 14 | 15 | include ../build/arm-tlm.mk 16 | -------------------------------------------------------------------------------- /test/unit_tests/.gitignore: -------------------------------------------------------------------------------- 1 | /.build 2 | Makefile 3 | -------------------------------------------------------------------------------- /test/unit_tests/README.md: -------------------------------------------------------------------------------- 1 | Unit tests 2 | ========== 3 | 4 | Building and running tests 5 | -------------------------- 6 | 7 | Create a build directory: 8 | 9 | ```bash 10 | rm -rf .build && mkdir .build && cd .build 11 | ``` 12 | 13 | Generate build files: 14 | 15 | ```bash 16 | cmake .. 17 | ``` 18 | 19 | Build and run the tests and coverage: 20 | 21 | ```bash 22 | make all test coverage 23 | ``` 24 | -------------------------------------------------------------------------------- /test/unit_tests/hal/simple_ntp_client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(compat) 2 | add_subdirectory(posix) 3 | -------------------------------------------------------------------------------- /test/unit_tests/mock/core_hal_mock.cpp: -------------------------------------------------------------------------------- 1 | #include "core_hal_mock.h" 2 | 3 | namespace particle::test { 4 | 5 | CoreHalMock* CoreHalMock::s_instance = nullptr; 6 | 7 | } // namespace particle::test 8 | -------------------------------------------------------------------------------- /test/unit_tests/mock/dct_hal_mock.cpp: -------------------------------------------------------------------------------- 1 | #include "dct_hal_mock.h" 2 | 3 | namespace particle::test { 4 | 5 | DctHalMock* DctHalMock::s_instance = nullptr; 6 | 7 | } // namespace particle::test 8 | -------------------------------------------------------------------------------- /test/unit_tests/mock/mbedtls_mock.cpp: -------------------------------------------------------------------------------- 1 | #include "mbedtls_mock.h" 2 | 3 | namespace particle::test { 4 | 5 | MbedtlsMock* MbedtlsMock::s_instance = nullptr; 6 | 7 | } // namespace particle::test 8 | -------------------------------------------------------------------------------- /test/unit_tests/services/fixtures/corrupted_eeprom_page1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot/device-os/99fd93b8965da95c112c6afb4058427109b1ad57/test/unit_tests/services/fixtures/corrupted_eeprom_page1.bin -------------------------------------------------------------------------------- /test/unit_tests/services/fixtures/corrupted_eeprom_page2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot/device-os/99fd93b8965da95c112c6afb4058427109b1ad57/test/unit_tests/services/fixtures/corrupted_eeprom_page2.bin -------------------------------------------------------------------------------- /test/unit_tests/services/fixtures/eeprom_page1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot/device-os/99fd93b8965da95c112c6afb4058427109b1ad57/test/unit_tests/services/fixtures/eeprom_page1.bin -------------------------------------------------------------------------------- /test/unit_tests/services/service_bytes2hex.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "bytes2hexbuf.h" 4 | #include 5 | 6 | TEST_CASE("bytes2hex_lower_") { 7 | SECTION("bytes are converted to lowercase hex") { 8 | uint8_t bytes[] = { 0x01, 0xFF, 0xA0, 0xb9 }; 9 | char out[4*2+1] = {0}; 10 | char* result = bytes2hexbuf_lower_case(bytes, 4, out); 11 | REQUIRE(!strcmp(out, "01ffa0b9")); 12 | REQUIRE(result==out); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/unit_tests/stub/dct_hal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | int dct_read_app_data_copy(uint32_t offset, void* ptr, size_t size); 11 | int dct_write_app_data(const void* data, uint32_t offset, uint32_t size); 12 | 13 | #ifdef __cplusplus 14 | } // extern "C" 15 | #endif 16 | -------------------------------------------------------------------------------- /test/unit_tests/stub/mbedtls/asn1.cpp: -------------------------------------------------------------------------------- 1 | #include "asn1.h" 2 | #include "mbedtls_mock.h" 3 | 4 | using namespace particle::test; 5 | 6 | int mbedtls_asn1_get_tag(unsigned char** p, const unsigned char* end, size_t* len, int tag) { 7 | auto mock = MbedtlsMock::instance(); 8 | if (mock) { 9 | return mock->get().asn1GetTag(p, end, len, tag); 10 | } 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /test/unit_tests/stub/mbedtls/asn1.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #define MBEDTLS_ASN1_SEQUENCE 0x10 6 | #define MBEDTLS_ASN1_CONSTRUCTED 0x20 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | int mbedtls_asn1_get_tag(unsigned char** p, const unsigned char* end, size_t* len, int tag); 13 | 14 | #ifdef __cplusplus 15 | } // extern "C" 16 | #endif 17 | -------------------------------------------------------------------------------- /test/unit_tests/stub/mbedtls_config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | -------------------------------------------------------------------------------- /test/unit_tests/stub/mbedtls_util.cpp: -------------------------------------------------------------------------------- 1 | #include "mbedtls_util.h" 2 | 3 | int mbedtls_to_system_error(int error) { 4 | return 0; 5 | } 6 | -------------------------------------------------------------------------------- /test/unit_tests/stub/security_mode.cpp: -------------------------------------------------------------------------------- 1 | #include "security_mode.h" 2 | 3 | int security_mode_get(void* reserved) { 4 | return 0; 5 | } 6 | -------------------------------------------------------------------------------- /test/unit_tests/stub/system_mode.cpp: -------------------------------------------------------------------------------- 1 | #include "system_mode.h" 2 | 3 | void set_system_mode(System_Mode_TypeDef mode) { 4 | } 5 | -------------------------------------------------------------------------------- /test/unit_tests/stub/system_pool.cpp: -------------------------------------------------------------------------------- 1 | #include "system_task.h" 2 | 3 | #include 4 | 5 | void* system_pool_alloc(size_t size, void* reserved) { 6 | return ::malloc(size); 7 | } 8 | 9 | void system_pool_free(void* ptr, void* reserved) { 10 | ::free(ptr); 11 | } 12 | -------------------------------------------------------------------------------- /test/unit_tests/stub/test_malloc.cpp: -------------------------------------------------------------------------------- 1 | #include "test_malloc.h" 2 | 3 | void* t_malloc(size_t size) { 4 | return ::malloc(size); 5 | } 6 | 7 | void* t_calloc(size_t count, size_t size) { 8 | return ::calloc(count, size); 9 | } 10 | 11 | void* t_realloc(void* ptr, size_t size) { 12 | return ::realloc(ptr, size); 13 | } 14 | 15 | void t_free(void* ptr) { 16 | ::free(ptr); 17 | } 18 | -------------------------------------------------------------------------------- /test/unit_tests/wiring/ipaddress.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "catch2/catch.hpp" 3 | 4 | #include "spark_wiring_ipaddress.h" 5 | 6 | TEST_CASE("Can Construct From Uint32") { 7 | 8 | IPAddress ip(1<<24 | 2<<16 | 3<<8 | 4); 9 | 10 | CHECK(ip[3]==4); 11 | CHECK(ip[2]==3); 12 | CHECK(ip[1]==2); 13 | CHECK(ip[0]==1); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /test/unit_tests/wiring/std_functions.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "catch2/catch.hpp" 3 | 4 | #include "spark_wiring_constants.h" 5 | 6 | TEST_CASE("Can use min() in main namespace in an application") { 7 | REQUIRE(min(10l, 5)==5); 8 | } 9 | 10 | TEST_CASE("Can use max() in main namespace in an application") { 11 | REQUIRE(min(10.0, 5)==5.0); 12 | } 13 | 14 | TEST_CASE("Can use round() in main namespace in an application") { 15 | REQUIRE(round(10.7)==11); 16 | } 17 | -------------------------------------------------------------------------------- /third_party/ambd_sdk/import.mk: -------------------------------------------------------------------------------- 1 | AMBD_SDK_MODULE_NAME = ambd_sdk 2 | AMBD_SDK_MODULE_PATH ?= $(PROJECT_ROOT)/third_party/$(AMBD_SDK_MODULE_NAME) 3 | include $(AMBD_SDK_MODULE_PATH)/include.mk 4 | 5 | AMBD_SDK_BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM) 6 | AMBD_SDK_LIB_DIR = $(BUILD_PATH_BASE)/$(AMBD_SDK_MODULE_NAME)/$(AMBD_SDK_BUILD_PATH_EXT) 7 | AMBD_SDK_LIB_DEP = $(AMBD_SDK_LIB_DIR)/lib$(AMBD_SDK_MODULE_NAME).a 8 | 9 | -------------------------------------------------------------------------------- /third_party/ambd_sdk/makefile: -------------------------------------------------------------------------------- 1 | MODULE=ambd_sdk 2 | AMBD_SDK_MODULE_PATH=. 3 | 4 | # Target this makefile is building. 5 | TARGET_TYPE = a 6 | 7 | BUILD_PATH_EXT=$(AMBD_SDK_BUILD_PATH_EXT) 8 | 9 | DEPENDENCIES = dynalib platform services third_party/freertos hal 10 | 11 | PROJECT_ROOT ?= ../.. 12 | include ../../build/arm-tlm.mk 13 | 14 | -------------------------------------------------------------------------------- /third_party/coremark/Makefile: -------------------------------------------------------------------------------- 1 | MODULE=coremark 2 | COREMARK_MODULE_PATH=. 3 | 4 | # Target this makefile is building. 5 | TARGET_TYPE = a 6 | 7 | BUILD_PATH_EXT=$(COREMARK_BUILD_PATH_EXT) 8 | 9 | DEPENDENCIES += services hal 10 | 11 | PROJECT_ROOT ?= ../.. 12 | include ../../build/arm-tlm.mk 13 | -------------------------------------------------------------------------------- /third_party/coremark/build.mk: -------------------------------------------------------------------------------- 1 | TARGET_COREMARK_SRC_PATH = $(COREMARK_MODULE_PATH)/coremark 2 | 3 | # C source files included in this build. 4 | CSRC += $(TARGET_COREMARK_SRC_PATH)/core_list_join.c 5 | CSRC += $(TARGET_COREMARK_SRC_PATH)/core_main.c 6 | CSRC += $(TARGET_COREMARK_SRC_PATH)/core_matrix.c 7 | CSRC += $(TARGET_COREMARK_SRC_PATH)/core_portme.c 8 | CSRC += $(TARGET_COREMARK_SRC_PATH)/core_state.c 9 | CSRC += $(TARGET_COREMARK_SRC_PATH)/core_util.c -------------------------------------------------------------------------------- /third_party/coremark/import.mk: -------------------------------------------------------------------------------- 1 | COREMARK_MODULE_NAME = coremark 2 | COREMARK_MODULE_PATH ?= $(PROJECT_ROOT)/third_party/$(COREMARK_MODULE_NAME) 3 | include $(COREMARK_MODULE_PATH)/include.mk 4 | 5 | COREMARK_BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM) 6 | COREMARK_LIB_DIR = $(BUILD_PATH_BASE)/$(COREMARK_MODULE_NAME)/$(COREMARK_BUILD_PATH_EXT) 7 | COREMARK_LIB_DEP = $(COREMARK_LIB_DIR)/lib$(COREMARK_MODULE_NAME).a 8 | -------------------------------------------------------------------------------- /third_party/coremark/include.mk: -------------------------------------------------------------------------------- 1 | TARGET_COREMARK_PATH = $(COREMARK_MODULE_PATH) 2 | INCLUDE_DIRS += $(COREMARK_MODULE_PATH)/coremark 3 | -------------------------------------------------------------------------------- /third_party/freertos/import.mk: -------------------------------------------------------------------------------- 1 | FREERTOS_MODULE_NAME = freertos 2 | FREERTOS_MODULE_PATH ?= $(PROJECT_ROOT)/third_party/$(FREERTOS_MODULE_NAME) 3 | include $(FREERTOS_MODULE_PATH)/include.mk 4 | 5 | FREERTOS_BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM) 6 | FREERTOS_LIB_DIR = $(BUILD_PATH_BASE)/$(FREERTOS_MODULE_NAME)/$(FREERTOS_BUILD_PATH_EXT) 7 | FREERTOS_LIB_DEP = $(FREERTOS_LIB_DIR)/lib$(FREERTOS_MODULE_NAME).a 8 | -------------------------------------------------------------------------------- /third_party/littlefs/build.mk: -------------------------------------------------------------------------------- 1 | TARGET_LITTLEFS_SRC_PATH = $(LITTLEFS_MODULE_PATH)/littlefs 2 | 3 | # C source files included in this build. 4 | CSRC += $(TARGET_LITTLEFS_SRC_PATH)/lfs_util.c 5 | CSRC += $(TARGET_LITTLEFS_SRC_PATH)/lfs.c 6 | -------------------------------------------------------------------------------- /third_party/littlefs/import.mk: -------------------------------------------------------------------------------- 1 | LITTLEFS_MODULE_NAME = littlefs 2 | LITTLEFS_MODULE_PATH ?= $(PROJECT_ROOT)/third_party/$(LITTLEFS_MODULE_NAME) 3 | include $(LITTLEFS_MODULE_PATH)/include.mk 4 | 5 | LITTLEFS_BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM) 6 | LITTLEFS_LIB_DIR = $(BUILD_PATH_BASE)/$(LITTLEFS_MODULE_NAME)/$(LITTLEFS_BUILD_PATH_EXT) 7 | LITTLEFS_LIB_DEP = $(LITTLEFS_LIB_DIR)/lib$(LITTLEFS_MODULE_NAME).a 8 | -------------------------------------------------------------------------------- /third_party/littlefs/include.mk: -------------------------------------------------------------------------------- 1 | TARGET_LITTLEFS_PATH = $(LITTLEFS_MODULE_PATH) 2 | INCLUDE_DIRS += $(LITTLEFS_MODULE_PATH)/littlefs 3 | 4 | CFLAGS += -DLFS_CONFIG=lfs_config.h 5 | -------------------------------------------------------------------------------- /third_party/littlefs/makefile: -------------------------------------------------------------------------------- 1 | MODULE=littlefs 2 | LITTLEFS_MODULE_PATH=. 3 | 4 | # Target this makefile is building. 5 | TARGET_TYPE = a 6 | 7 | BUILD_PATH_EXT=$(LITTLEFS_BUILD_PATH_EXT) 8 | 9 | DEPENDENCIES = hal platform dynalib services 10 | 11 | # FIXME 12 | # ifneq ("$(BOOTLOADER_MODULE)","1") 13 | # DEPENDENCIES += services 14 | # endif 15 | 16 | PROJECT_ROOT ?= ../.. 17 | include ../../build/arm-tlm.mk 18 | -------------------------------------------------------------------------------- /third_party/lwip/build.mk: -------------------------------------------------------------------------------- 1 | TARGET_LWIP_SRC_PATH = $(LWIP_MODULE_PATH)/lwip/src 2 | 3 | LWIPDIR = $(TARGET_LWIP_SRC_PATH) 4 | include $(TARGET_LWIP_SRC_PATH)/Filelists.mk 5 | 6 | CSRC += $(LWIPNOAPPSFILES) 7 | 8 | # FIXME: we'd rather not have this enabled and instead fix the issue in LwIP code 9 | CFLAGS += -Wno-unused-variable 10 | 11 | ifeq ("$(PLATFORM_LWIP)","posix") 12 | CSRC += $(LWIP_MODULE_PATH)/lwip-contrib/ports/unix/port/netif/tapif.c 13 | endif 14 | -------------------------------------------------------------------------------- /third_party/lwip/import.mk: -------------------------------------------------------------------------------- 1 | LWIP_MODULE_NAME = lwip 2 | LWIP_MODULE_PATH ?= $(PROJECT_ROOT)/third_party/$(LWIP_MODULE_NAME) 3 | include $(LWIP_MODULE_PATH)/include.mk 4 | 5 | LWIP_BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM) 6 | LWIP_LIB_DIR = $(BUILD_PATH_BASE)/$(LWIP_MODULE_NAME)/$(LWIP_BUILD_PATH_EXT) 7 | LWIP_LIB_DEP = $(LWIP_LIB_DIR)/lib$(LWIP_MODULE_NAME).a 8 | -------------------------------------------------------------------------------- /third_party/lwip/include.mk: -------------------------------------------------------------------------------- 1 | TARGET_LWIP_PATH = $(LWIP_MODULE_PATH) 2 | INCLUDE_DIRS += $(LWIP_MODULE_PATH)/lwip/src/include 3 | 4 | ifeq ("$(PLATFORM_LWIP)","posix") 5 | INCLUDE_DIRS += $(LWIP_MODULE_PATH)/lwip-contrib/ports/unix/port/include 6 | endif 7 | -------------------------------------------------------------------------------- /third_party/lwip/makefile: -------------------------------------------------------------------------------- 1 | MODULE=lwip 2 | LWIP_MODULE_PATH=. 3 | 4 | # Target this makefile is building. 5 | TARGET_TYPE = a 6 | 7 | BUILD_PATH_EXT=$(LWIP_BUILD_PATH_EXT) 8 | 9 | # depends only on headers. Will it work? 10 | DEPENDENCIES = hal platform 11 | 12 | PROJECT_ROOT ?= ../.. 13 | include ../../build/arm-tlm.mk 14 | -------------------------------------------------------------------------------- /third_party/mbedtls/build.mk: -------------------------------------------------------------------------------- 1 | TARGET_MBEDTLS_SRC_PATH = $(MBEDTLS_MODULE_PATH)/mbedtls/library 2 | 3 | # C source files included in this build. 4 | CSRC += $(call target_files,$(TARGET_MBEDTLS_SRC_PATH)/,*.c) 5 | 6 | CFLAGS += -Wno-array-parameter 7 | -------------------------------------------------------------------------------- /third_party/mbedtls/import.mk: -------------------------------------------------------------------------------- 1 | MBEDTLS_MODULE_NAME = mbedtls 2 | MBEDTLS_MODULE_PATH ?= $(PROJECT_ROOT)/third_party/$(MBEDTLS_MODULE_NAME) 3 | include $(MBEDTLS_MODULE_PATH)/include.mk 4 | 5 | MBEDTLS_BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM) 6 | MBEDTLS_LIB_DIR = $(BUILD_PATH_BASE)/$(MBEDTLS_MODULE_NAME)/$(MBEDTLS_BUILD_PATH_EXT) 7 | MBEDTLS_LIB_DEP = $(MBEDTLS_LIB_DIR)/lib$(MBEDTLS_MODULE_NAME).a 8 | -------------------------------------------------------------------------------- /third_party/mbedtls/include.mk: -------------------------------------------------------------------------------- 1 | TARGET_MBEDTLS_PATH = $(MBEDTLS_MODULE_PATH) 2 | INCLUDE_DIRS += $(MBEDTLS_MODULE_PATH)/mbedtls/include 3 | -------------------------------------------------------------------------------- /third_party/mbedtls/makefile: -------------------------------------------------------------------------------- 1 | MODULE=mbedtls 2 | MBEDTLS_MODULE_PATH=. 3 | 4 | # Target this makefile is building. 5 | TARGET_TYPE = a 6 | 7 | BUILD_PATH_EXT=$(MBEDTLS_BUILD_PATH_EXT) 8 | 9 | # depends only on headers. Will it work? 10 | DEPENDENCIES = crypto platform hal 11 | 12 | PROJECT_ROOT ?= ../.. 13 | include ../../build/arm-tlm.mk 14 | -------------------------------------------------------------------------------- /third_party/miniz/Makefile: -------------------------------------------------------------------------------- 1 | MODULE=miniz 2 | MINIZ_MODULE_PATH=. 3 | 4 | # Target this makefile is building. 5 | TARGET_TYPE = a 6 | 7 | BUILD_PATH_EXT=$(MINIZ_BUILD_PATH_EXT) 8 | 9 | # depends only on headers. Will it work? 10 | DEPENDENCIES = hal 11 | 12 | PROJECT_ROOT ?= ../.. 13 | include ../../build/arm-tlm.mk 14 | -------------------------------------------------------------------------------- /third_party/miniz/build.mk: -------------------------------------------------------------------------------- 1 | TARGET_MINIZ_SRC_PATH = $(MINIZ_MODULE_PATH)/miniz 2 | 3 | # C source files included in this build. 4 | CSRC += \ 5 | $(TARGET_MINIZ_SRC_PATH)/miniz_tinfl.c 6 | -------------------------------------------------------------------------------- /third_party/miniz/import.mk: -------------------------------------------------------------------------------- 1 | MINIZ_MODULE_NAME = miniz 2 | MINIZ_MODULE_PATH ?= $(PROJECT_ROOT)/third_party/$(MINIZ_MODULE_NAME) 3 | include $(MINIZ_MODULE_PATH)/include.mk 4 | 5 | MINIZ_BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM) 6 | MINIZ_LIB_DIR = $(BUILD_PATH_BASE)/$(MINIZ_MODULE_NAME)/$(MINIZ_BUILD_PATH_EXT) 7 | MINIZ_LIB_DEP = $(MINIZ_LIB_DIR)/lib$(MINIZ_MODULE_NAME).a 8 | -------------------------------------------------------------------------------- /third_party/miniz/include.mk: -------------------------------------------------------------------------------- 1 | TARGET_MINIZ_PATH = $(MINIZ_MODULE_PATH) 2 | INCLUDE_DIRS += $(MINIZ_MODULE_PATH)/miniz 3 | -------------------------------------------------------------------------------- /third_party/nanopb/build.mk: -------------------------------------------------------------------------------- 1 | TARGET_NANOPB_SRC_PATH = $(NANOPB_MODULE_PATH)/nanopb 2 | 3 | # C source files included in this build. 4 | CSRC += $(TARGET_NANOPB_SRC_PATH)/pb_common.c 5 | CSRC += $(TARGET_NANOPB_SRC_PATH)/pb_encode.c 6 | CSRC += $(TARGET_NANOPB_SRC_PATH)/pb_decode.c 7 | -------------------------------------------------------------------------------- /third_party/nanopb/import.mk: -------------------------------------------------------------------------------- 1 | NANOPB_MODULE_NAME = nanopb 2 | NANOPB_MODULE_PATH ?= $(PROJECT_ROOT)/third_party/$(NANOPB_MODULE_NAME) 3 | include $(NANOPB_MODULE_PATH)/include.mk 4 | 5 | NANOPB_BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM) 6 | NANOPB_LIB_DIR = $(BUILD_PATH_BASE)/$(NANOPB_MODULE_NAME)/$(NANOPB_BUILD_PATH_EXT) 7 | NANOPB_LIB_DEP = $(NANOPB_LIB_DIR)/lib$(NANOPB_MODULE_NAME).a 8 | -------------------------------------------------------------------------------- /third_party/nanopb/include.mk: -------------------------------------------------------------------------------- 1 | TARGET_NANOPB_PATH = $(NANOPB_MODULE_PATH) 2 | INCLUDE_DIRS += $(NANOPB_MODULE_PATH)/nanopb 3 | -------------------------------------------------------------------------------- /third_party/nanopb/makefile: -------------------------------------------------------------------------------- 1 | MODULE=nanopb 2 | NANOPB_MODULE_PATH=. 3 | 4 | # Target this makefile is building. 5 | TARGET_TYPE = a 6 | 7 | BUILD_PATH_EXT=$(NANOPB_BUILD_PATH_EXT) 8 | 9 | DEPENDENCIES = 10 | 11 | PROJECT_ROOT ?= ../.. 12 | include ../../build/arm-tlm.mk 13 | -------------------------------------------------------------------------------- /third_party/nrf5_sdk/import.mk: -------------------------------------------------------------------------------- 1 | NRF5_SDK_MODULE_NAME = nrf5_sdk 2 | NRF5_SDK_MODULE_PATH ?= $(PROJECT_ROOT)/third_party/$(NRF5_SDK_MODULE_NAME) 3 | include $(NRF5_SDK_MODULE_PATH)/include.mk 4 | 5 | NRF5_SDK_BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM) 6 | NRF5_SDK_LIB_DIR = $(BUILD_PATH_BASE)/$(NRF5_SDK_MODULE_NAME)/$(NRF5_SDK_BUILD_PATH_EXT) 7 | NRF5_SDK_LIB_DEP = $(NRF5_SDK_LIB_DIR)/lib$(NRF5_SDK_MODULE_NAME).a 8 | -------------------------------------------------------------------------------- /third_party/nrf5_sdk/makefile: -------------------------------------------------------------------------------- 1 | MODULE=nrf5_sdk 2 | NRF5_SDK_MODULE_PATH=. 3 | 4 | # Target this makefile is building. 5 | TARGET_TYPE = a 6 | 7 | BUILD_PATH_EXT=$(NRF5_SDK_BUILD_PATH_EXT) 8 | 9 | # depends only on headers. Will it work? 10 | DEPENDENCIES = dynalib platform services third_party/freertos hal 11 | 12 | PROJECT_ROOT ?= ../.. 13 | include ../../build/arm-tlm.mk 14 | -------------------------------------------------------------------------------- /third_party/wiznet_driver/build.mk: -------------------------------------------------------------------------------- 1 | TARGET_WIZNET_DRIVER_SRC_PATH = $(WIZNET_DRIVER_MODULE_PATH)/wiznet_driver 2 | 3 | # C source files included in this build. 4 | CSRC += $(TARGET_WIZNET_DRIVER_SRC_PATH)/Ethernet/wizchip_conf.c 5 | 6 | CFLAGS += -Wno-missing-braces -Wno-parentheses -Wno-unused-variable 7 | 8 | ifeq ("$(PLATFORM_WIZNET)","W5500") 9 | CSRC += $(TARGET_WIZNET_DRIVER_SRC_PATH)/Ethernet/W5500/w5500.c 10 | endif 11 | -------------------------------------------------------------------------------- /third_party/wiznet_driver/import.mk: -------------------------------------------------------------------------------- 1 | WIZNET_DRIVER_MODULE_NAME = wiznet_driver 2 | WIZNET_DRIVER_MODULE_PATH ?= $(PROJECT_ROOT)/third_party/$(WIZNET_DRIVER_MODULE_NAME) 3 | include $(WIZNET_DRIVER_MODULE_PATH)/include.mk 4 | 5 | WIZNET_DRIVER_BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM) 6 | WIZNET_DRIVER_LIB_DIR = $(BUILD_PATH_BASE)/$(WIZNET_DRIVER_MODULE_NAME)/$(WIZNET_DRIVER_BUILD_PATH_EXT) 7 | WIZNET_DRIVER_LIB_DEP = $(WIZNET_DRIVER_LIB_DIR)/lib$(WIZNET_DRIVER_MODULE_NAME).a 8 | -------------------------------------------------------------------------------- /third_party/wiznet_driver/include.mk: -------------------------------------------------------------------------------- 1 | TARGET_WIZNET_DRIVER_PATH = $(WIZNET_DRIVER_MODULE_PATH) 2 | 3 | INCLUDE_DIRS += $(WIZNET_DRIVER_MODULE_PATH)/wiznet_driver/Ethernet 4 | 5 | ifneq ("$(PLATFORM_WIZNET)","") 6 | CFLAGS += -D_WIZCHIP_=$(PLATFORM_WIZNET) 7 | endif 8 | -------------------------------------------------------------------------------- /third_party/wiznet_driver/makefile: -------------------------------------------------------------------------------- 1 | MODULE=wiznet_driver 2 | WIZNET_DRIVER_MODULE_PATH=. 3 | 4 | # Target this makefile is building. 5 | TARGET_TYPE = a 6 | 7 | BUILD_PATH_EXT=$(WIZNET_DRIVER_BUILD_PATH_EXT) 8 | 9 | DEPENDENCIES = platform 10 | 11 | PROJECT_ROOT ?= ../.. 12 | include ../../build/arm-tlm.mk 13 | -------------------------------------------------------------------------------- /user/.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | 4 | # Libraries 5 | *.lib 6 | *.a 7 | 8 | # Shared objects (inc. Windows DLLs) 9 | *.dll 10 | *.so 11 | *.so.* 12 | *.dylib 13 | 14 | # Executables 15 | *.exe 16 | *.out 17 | *.app 18 | 19 | # Debug folder 20 | Debug/* 21 | 22 | # Release folder 23 | Release/* 24 | 25 | # build folder 26 | *.map 27 | *.lst 28 | *.d 29 | *.o 30 | 31 | # Platform-specific settings 32 | .settings/* 33 | .cproject 34 | .project 35 | .DS_Store 36 | -------------------------------------------------------------------------------- /user/applications/otastress/otastress.sh: -------------------------------------------------------------------------------- 1 | device=$1 2 | file=$2 3 | 4 | function wait_for_device() 5 | { 6 | while [[ `particle variable get $device ready` != '1' ]]; do 7 | sleep 5 8 | done 9 | } 10 | 11 | 12 | echo "Runing OTA stress test on $device with file $file" 13 | 14 | for i in `seq 1 100`; 15 | do 16 | echo "waiting for device to come online " $i: 17 | wait_for_device 18 | echo "starting ota" 19 | particle flash $device $file 20 | done 21 | -------------------------------------------------------------------------------- /user/applications/product_id_and_version/application.cpp: -------------------------------------------------------------------------------- 1 | #include "Particle.h" 2 | 3 | // To verify product creator macros work correctly. 4 | // These values get sent to the cloud on connection and help dashboard.particle.io do the right thing 5 | // 6 | PRODUCT_VERSION(3); 7 | 8 | void setup() { 9 | pinMode(LED_PIN_USER, OUTPUT); 10 | } 11 | 12 | void loop() { 13 | digitalWrite(LED_PIN_USER, HIGH); 14 | delay(100); 15 | digitalWrite(LED_PIN_USER, LOW); 16 | delay(100); 17 | } 18 | -------------------------------------------------------------------------------- /user/applications/tinker/include.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(APP),tinker) 2 | COREMARK_DEPENDENCY = third_party/coremark 3 | 4 | include $(PROJECT_ROOT)/$(COREMARK_DEPENDENCY)/import.mk 5 | 6 | LIBS += $(notdir $(COREMARK_DEPENDENCY)) 7 | LIB_DIRS += $(COREMARK_LIB_DIR) 8 | endif 9 | -------------------------------------------------------------------------------- /user/applications/unlocker/unlocker.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "application.h" 3 | #include "flash_mal.h" 4 | 5 | SYSTEM_MODE(MANUAL) 6 | 7 | bool FLASH_WriteProtectMemory(flash_device_t flashDeviceID, uint32_t startAddress, uint32_t length, bool protect); 8 | 9 | void setup() 10 | { 11 | RGB.control(true); 12 | RGB.color(255,255,0); 13 | FLASH_WriteProtectMemory(FLASH_INTERNAL, 0x8000000, 0x100000, false); 14 | RGB.color(0,255,0); 15 | } 16 | -------------------------------------------------------------------------------- /user/inc/Particle.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef PARTICLE_H 3 | #define PARTICLE_H 4 | 5 | #include "application.h" 6 | 7 | #endif /* PARTICLE_H */ 8 | 9 | -------------------------------------------------------------------------------- /user/inc/Print.h: -------------------------------------------------------------------------------- 1 | #include "Arduino.h" 2 | -------------------------------------------------------------------------------- /user/inc/SPI.h: -------------------------------------------------------------------------------- 1 | #include "Arduino.h" 2 | -------------------------------------------------------------------------------- /user/inc/Stream.h: -------------------------------------------------------------------------------- 1 | #include "Arduino.h" 2 | -------------------------------------------------------------------------------- /user/inc/WProgram.h: -------------------------------------------------------------------------------- 1 | #include "Arduino.h" 2 | -------------------------------------------------------------------------------- /user/inc/WString.h: -------------------------------------------------------------------------------- 1 | #include "Arduino.h" 2 | -------------------------------------------------------------------------------- /user/inc/Wire.h: -------------------------------------------------------------------------------- 1 | #include "Arduino.h" 2 | -------------------------------------------------------------------------------- /user/inc/include.mk: -------------------------------------------------------------------------------- 1 | 2 | # Add include to all objects built for this target 3 | INCLUDE_DIRS += $(USER_MODULE_PATH)/inc 4 | -------------------------------------------------------------------------------- /user/libraries/Serial2/.Serial2.h.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot/device-os/99fd93b8965da95c112c6afb4058427109b1ad57/user/libraries/Serial2/.Serial2.h.swp -------------------------------------------------------------------------------- /user/libraries/Serial2/Serial2.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIB_SERIAL2_H 2 | #define __LIB_SERIAL2_H 3 | 4 | #include "spark_wiring_usartserial.h" 5 | 6 | // Placeholder for backwards compatibility 7 | // The instantiation of SerialX classes has been moved to wiring_globals_usart.cpp 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /user/libraries/Serial3/Serial3.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIB_SERIAL3_H 2 | #define __LIB_SERIAL3_H 3 | 4 | #include "spark_wiring_usartserial.h" 5 | 6 | // Placeholder for backwards compatibility 7 | // The instantiation of SerialX classes has been moved to wiring_globals_usart.cpp 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /user/libraries/Serial4/Serial4.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot/device-os/99fd93b8965da95c112c6afb4058427109b1ad57/user/libraries/Serial4/Serial4.h -------------------------------------------------------------------------------- /user/libraries/Serial5/Serial5.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot/device-os/99fd93b8965da95c112c6afb4058427109b1ad57/user/libraries/Serial5/Serial5.h -------------------------------------------------------------------------------- /user/makefile: -------------------------------------------------------------------------------- 1 | MODULE=user 2 | USER_MODULE_PATH=. 3 | 4 | BUILD_PATH_EXT = $(USER_BUILD_PATH_EXT) 5 | 6 | DEPENDENCIES = wiring system services communication hal 7 | 8 | ifdef TEST 9 | DEPENDENCIES += crypto 10 | endif 11 | 12 | include ../build/platform-id.mk 13 | 14 | ifeq ("","$(SPARK_NO_PLATFORM)") 15 | DEPENDENCIES += platform 16 | CFLAGS += -DSPARK_PLATFORM 17 | endif 18 | 19 | DEPENDENCIES += dynalib 20 | 21 | WARNINGS_AS_ERRORS ?= n 22 | 23 | TARGET_TYPE = a 24 | 25 | include ../build/arm-tlm.mk 26 | -------------------------------------------------------------------------------- /user/tests/app/band_select/band_select.cpp: -------------------------------------------------------------------------------- 1 | #include "Particle.h" 2 | 3 | // Placeholder for band select tests for Gen 3 4 | #if HAL_PLATFORM_NCP 5 | #error "Tests currently don't exist for Gen 3 Cellular devices" 6 | #endif // HAL_PLATFORM_NCP 7 | 8 | -------------------------------------------------------------------------------- /user/tests/app/device_initiated_describe/test.mk: -------------------------------------------------------------------------------- 1 | ifeq (${AUTOMATIC},y) 2 | USE_AUTOMATIC_MODE=1 3 | else 4 | USE_AUTOMATIC_MODE=0 5 | endif 6 | 7 | CFLAGS += -DUSE_AUTOMATIC_MODE=${USE_AUTOMATIC_MODE} 8 | -------------------------------------------------------------------------------- /user/tests/app/ledger_test/app/config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace particle::test { 6 | 7 | struct Config { 8 | bool autoConnect; 9 | bool restoreConnection; 10 | bool wasConnected; 11 | bool removeLedger; 12 | bool removeAllLedgers; 13 | bool debugEnabled; 14 | 15 | char removeLedgerName[LEDGER_MAX_NAME_LENGTH + 1]; 16 | 17 | void setRestoreConnectionFlag(); 18 | 19 | static Config& get(); 20 | }; 21 | 22 | } // namespace particle::test 23 | -------------------------------------------------------------------------------- /user/tests/app/ledger_test/app/logger.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace particle::test { 4 | 5 | int initLogger(); 6 | 7 | } // namespace particle::test 8 | -------------------------------------------------------------------------------- /user/tests/app/ledger_test/build.mk: -------------------------------------------------------------------------------- 1 | CPPSRC += $(call target_files,$(MODULE_PATH)/$(USRSRC)/app/,*.cpp) 2 | -------------------------------------------------------------------------------- /user/tests/app/ledger_test/cli/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ledger", 3 | "description": "Ledger Test Utility", 4 | "private": true, 5 | "main": "ledger", 6 | "bin": "ledger", 7 | "dependencies": { 8 | "cbor": "^9.0.1", 9 | "lodash": "^4.17.21", 10 | "minimist": "^1.2.8", 11 | "particle-usb": "^2.4.1" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /user/tests/app/listen_mode/listen_mode.cpp: -------------------------------------------------------------------------------- 1 | #include "Particle.h" 2 | 3 | SYSTEM_MODE(MANUAL); 4 | 5 | STARTUP(System.enable(SYSTEM_FLAG_WIFITESTER_OVER_SERIAL1)); 6 | STARTUP(System.enableFeature(FEATURE_WIFITESTER)); 7 | 8 | // SerialLogHandler logHandler(LOG_LEVEL_ALL); // >= 0.6.0 9 | // SerialDebugOutput debugOutput(9600, ALL_LEVEL); // < 0.6.0 10 | 11 | void setup() { 12 | //Network.listen(); 13 | Cellular.listen(); 14 | } 15 | -------------------------------------------------------------------------------- /user/tests/app/manual_mode_threading/manual_mode_threading.cpp: -------------------------------------------------------------------------------- 1 | #include "application.h" 2 | 3 | SYSTEM_MODE(MANUAL); 4 | SYSTEM_THREAD(ENABLED); 5 | 6 | void setup() { 7 | Serial.begin(9600); 8 | delay(1000); 9 | } 10 | 11 | void loop() { 12 | //WiFi.hasCredentials(); // Problem 1: never connects. Comment out to fix. 13 | Serial.print("."); 14 | if (Particle.connected() == false) { 15 | Serial.println("Connecting"); 16 | Particle.connect(); 17 | } else { 18 | WiFi.hasCredentials(); // Problem 2: dropped connections. Comment out to fix. 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /user/tests/app/mcp23017/application.cpp: -------------------------------------------------------------------------------- 1 | #include "application.h" 2 | #include "Adafruit_MCP23017.h" 3 | 4 | 5 | SYSTEM_THREAD(ENABLED); 6 | 7 | Adafruit_MCP23017 myPE; 8 | 9 | void setup() 10 | { 11 | Serial.begin(9600); 12 | 13 | 14 | Serial.println("Example program w/ real i2c traffic"); 15 | 16 | myPE.begin(); 17 | myPE.pinMode(0,OUTPUT); 18 | myPE.pinMode(1,INPUT); 19 | } 20 | 21 | void loop() 22 | { 23 | delayMicroseconds(1000*50); 24 | 25 | //i2c transactions w/ our PE 26 | myPE.digitalWrite(0, myPE.digitalRead(1) ); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /user/tests/app/tcp_server/README.md: -------------------------------------------------------------------------------- 1 | Flash server application to the device (add USE_THREADING=y option to enable threading): 2 | $ cd ~/firmware/modules 3 | $ make -s all program-dfu PLATFORM=argon TEST=app/tcp_server 4 | 5 | Install client dependencies: 6 | $ cd ~/firmware/user/tests/app/tcp_server/client 7 | $ npm install 8 | 9 | Run client: 10 | $ ./client 11 | -------------------------------------------------------------------------------- /user/tests/app/tcp_server/client/client: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | if [ ! $PLATFORM ]; then 6 | echo 'PLATFORM is not defined, assuming Argon' 7 | export PLATFORM=argon 8 | fi 9 | 10 | this_dir=$(cd $(dirname "$0") && pwd) 11 | test_dir=$(cd "$this_dir/../../../accept" && pwd) 12 | 13 | PATH="$test_dir/tools:$PATH" 14 | source "$test_dir/init_env" 15 | 16 | node "$this_dir/main.js" 17 | -------------------------------------------------------------------------------- /user/tests/app/tcp_server/client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "client", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "main.js", 6 | "dependencies": { 7 | "randomstring": "^1.1.5", 8 | "bluebird": "^3.5.0", 9 | "lodash": "^4.17.4" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /user/tests/app/tcp_server/test.mk: -------------------------------------------------------------------------------- 1 | ifeq ("${USE_THREADING}","y") 2 | USE_THREADING_VALUE=1 3 | else 4 | USE_THREADING_VALUE=0 5 | endif 6 | 7 | CFLAGS += -DUSE_THREADING=${USE_THREADING_VALUE} 8 | -------------------------------------------------------------------------------- /user/tests/app/usb_ctrl_request/README.md: -------------------------------------------------------------------------------- 1 | Build the test application and flash it to the device: 2 | ``` 3 | $ cd ~/firmware/modules 4 | $ make -s all program-dfu PLATFORM=boron TEST=app/usb_ctrl_request/app 5 | ``` 6 | 7 | Install dependencies and run the test suite: 8 | ``` 9 | $ cd ~/firmware/user/tests/app/usb_ctrl_request/test 10 | $ npm install 11 | $ npm test 12 | ``` 13 | -------------------------------------------------------------------------------- /user/tests/app/usb_ctrl_request/test/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["env"] 3 | } 4 | -------------------------------------------------------------------------------- /user/tests/app/usb_ctrl_request/test/test/support/init.js: -------------------------------------------------------------------------------- 1 | import chai from 'chai'; 2 | import chaiAsPromised from 'chai-as-promised'; 3 | 4 | chai.use(chaiAsPromised); 5 | chai.should(); 6 | -------------------------------------------------------------------------------- /user/tests/hal/cellular/application.cpp: -------------------------------------------------------------------------------- 1 | #include "application.h" 2 | #include "unit-test/unit-test.h" 3 | 4 | UNIT_TEST_APP(); 5 | -------------------------------------------------------------------------------- /user/tests/integration/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | -------------------------------------------------------------------------------- /user/tests/integration/ota/min_max_app_size/test.mk: -------------------------------------------------------------------------------- 1 | CFLAGS += -DNO_TEST_APP_INIT -DNO_TEST_APP_SETUP_AND_LOOP 2 | -------------------------------------------------------------------------------- /user/tests/integration/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Device OS Integration Tests", 3 | "private": true, 4 | "dependencies": { 5 | "@particle/device-constants": "^3.5.0", 6 | "binary-version-reader": "^2.4.0", 7 | "chai-exclude": "^2.1.0", 8 | "particle-api-js": "^10.4.2", 9 | "tempy": "^1.0.1" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /user/tests/integration/slo/application_max_size/application_max_size.spec.js: -------------------------------------------------------------------------------- 1 | suite('Application max size'); 2 | 3 | platform('gen3', 'gen4'); 4 | systemThread('enabled'); 5 | -------------------------------------------------------------------------------- /user/tests/integration/slo/connect_time/test.mk: -------------------------------------------------------------------------------- 1 | CFLAGS += -DNO_TEST_APP_INIT -DNO_TEST_APP_SETUP_AND_LOOP 2 | -------------------------------------------------------------------------------- /user/tests/integration/slo/startup/README.md: -------------------------------------------------------------------------------- 1 | This integration test suite is used to measure key device start up metrics and make assertions against them. 2 | 3 | It includes assertions against available RAM and flash size. 4 | 5 | This test runs as part of every Device OS release on all supported platforms. 6 | -------------------------------------------------------------------------------- /user/tests/integration/test.mk: -------------------------------------------------------------------------------- 1 | CPPSRC += $(call target_files,$(MODULE_PATH)/tests/integration/application/src,*.cpp) 2 | INCLUDE_DIRS += $(MODULE_PATH)/tests/integration/application/include 3 | -------------------------------------------------------------------------------- /user/tests/integration/wiring/acm: -------------------------------------------------------------------------------- 1 | ../../wiring/acm -------------------------------------------------------------------------------- /user/tests/integration/wiring/ble_central_peripheral: -------------------------------------------------------------------------------- 1 | ../../wiring/ble_central_peripheral -------------------------------------------------------------------------------- /user/tests/integration/wiring/ble_scanner_broadcaster: -------------------------------------------------------------------------------- 1 | ../../wiring/ble_scanner_broadcaster -------------------------------------------------------------------------------- /user/tests/integration/wiring/filesystem: -------------------------------------------------------------------------------- 1 | ../../wiring/filesystem -------------------------------------------------------------------------------- /user/tests/integration/wiring/gen3_invalid_compat_user_app: -------------------------------------------------------------------------------- 1 | ../../wiring/gen3_invalid_compat_user_app -------------------------------------------------------------------------------- /user/tests/integration/wiring/i2c_master_slave: -------------------------------------------------------------------------------- 1 | ../../wiring/i2c_master_slave -------------------------------------------------------------------------------- /user/tests/integration/wiring/i2c_mcp23017: -------------------------------------------------------------------------------- 1 | ../../wiring/i2c_mcp23017 -------------------------------------------------------------------------------- /user/tests/integration/wiring/ledger: -------------------------------------------------------------------------------- 1 | ../../wiring/ledger -------------------------------------------------------------------------------- /user/tests/integration/wiring/network_config: -------------------------------------------------------------------------------- 1 | ../../wiring/network_config -------------------------------------------------------------------------------- /user/tests/integration/wiring/no_fixture: -------------------------------------------------------------------------------- 1 | ../../wiring/no_fixture -------------------------------------------------------------------------------- /user/tests/integration/wiring/no_fixture_ble: -------------------------------------------------------------------------------- 1 | ../../wiring/no_fixture_ble -------------------------------------------------------------------------------- /user/tests/integration/wiring/no_fixture_cellular: -------------------------------------------------------------------------------- 1 | ../../wiring/no_fixture_cellular -------------------------------------------------------------------------------- /user/tests/integration/wiring/no_fixture_i2c: -------------------------------------------------------------------------------- 1 | ../../wiring/no_fixture_i2c -------------------------------------------------------------------------------- /user/tests/integration/wiring/no_fixture_long_running: -------------------------------------------------------------------------------- 1 | ../../wiring/no_fixture_long_running -------------------------------------------------------------------------------- /user/tests/integration/wiring/no_fixture_power_saving: -------------------------------------------------------------------------------- 1 | ../../wiring/no_fixture_power_saving -------------------------------------------------------------------------------- /user/tests/integration/wiring/no_fixture_spi: -------------------------------------------------------------------------------- 1 | ../../wiring/no_fixture_spi -------------------------------------------------------------------------------- /user/tests/integration/wiring/no_fixture_stress: -------------------------------------------------------------------------------- 1 | ../../wiring/no_fixture_stress -------------------------------------------------------------------------------- /user/tests/integration/wiring/no_fixture_wifi: -------------------------------------------------------------------------------- 1 | ../../wiring/no_fixture_wifi -------------------------------------------------------------------------------- /user/tests/integration/wiring/serial_loopback: -------------------------------------------------------------------------------- 1 | ../../wiring/serial_loopback -------------------------------------------------------------------------------- /user/tests/integration/wiring/serial_loopback2: -------------------------------------------------------------------------------- 1 | ../../wiring/serial_loopback2 -------------------------------------------------------------------------------- /user/tests/integration/wiring/sleep20: -------------------------------------------------------------------------------- 1 | ../../wiring/sleep20 -------------------------------------------------------------------------------- /user/tests/integration/wiring/spi_master_slave: -------------------------------------------------------------------------------- 1 | ../../wiring/spi_master_slave -------------------------------------------------------------------------------- /user/tests/integration/wiring/strformat: -------------------------------------------------------------------------------- 1 | ../../wiring/strformat -------------------------------------------------------------------------------- /user/tests/integration/wiring/time_compat: -------------------------------------------------------------------------------- 1 | ../../wiring/time_compat -------------------------------------------------------------------------------- /user/tests/integration/wiring/watchdog: -------------------------------------------------------------------------------- 1 | ../../wiring/watchdog -------------------------------------------------------------------------------- /user/tests/tests.mk: -------------------------------------------------------------------------------- 1 | # set up environment for compiling test apps 2 | # for now, hard-wire the unit-test library 3 | 4 | INCLUDE_DIRS += tests/libraries 5 | CPPSRC += $(call target_files,tests/libraries/unit-test,*.cpp) 6 | 7 | # Disable compiler warnings when deprecated APIs are used in test code 8 | CFLAGS+=-DPARTICLE_USING_DEPRECATED_API 9 | -------------------------------------------------------------------------------- /user/tests/wiring/acm/acm.config.js: -------------------------------------------------------------------------------- 1 | { 2 | "fixtures": [ 3 | { 4 | "name": "acm", 5 | "devices": [ 6 | ] 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /user/tests/wiring/acm/acm.spec.js: -------------------------------------------------------------------------------- 1 | suite('ACM'); 2 | 3 | platform('gen3', 'gen4'); 4 | 5 | fixture('acm'); 6 | // This tag should be filtered out by default 7 | tag('fixture'); -------------------------------------------------------------------------------- /user/tests/wiring/acm/application.cpp: -------------------------------------------------------------------------------- 1 | #ifndef PARTICLE_TEST_RUNNER 2 | 3 | #include "application.h" 4 | #include "unit-test/unit-test.h" 5 | 6 | SYSTEM_MODE(SEMI_AUTOMATIC); 7 | 8 | #if USE_THREADING 9 | SYSTEM_THREAD(ENABLED); 10 | #endif 11 | 12 | UNIT_TEST_APP(); 13 | 14 | #endif // !defined(PARTICLE_TEST_RUNNER) 15 | -------------------------------------------------------------------------------- /user/tests/wiring/acm/test.mk: -------------------------------------------------------------------------------- 1 | ifeq ("${USE_THREADING}","y") 2 | CFLAGS += -DUSE_THREADING=1 3 | else 4 | CFLAGS += -DUSE_THREADING=0 5 | endif 6 | -------------------------------------------------------------------------------- /user/tests/wiring/adc_dac/application.cpp: -------------------------------------------------------------------------------- 1 | #include "application.h" 2 | #include "unit-test/unit-test.h" 3 | 4 | SYSTEM_MODE(MANUAL); 5 | 6 | UNIT_TEST_APP(); 7 | -------------------------------------------------------------------------------- /user/tests/wiring/api/adc.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "testapi.h" 3 | -------------------------------------------------------------------------------- /user/tests/wiring/api/application.cpp: -------------------------------------------------------------------------------- 1 | #include "application.h" 2 | #include "unit-test/unit-test.h" 3 | 4 | bool runthisstuff = false; 5 | 6 | SYSTEM_MODE(SEMI_AUTOMATIC); 7 | 8 | UNIT_TEST_APP(); 9 | -------------------------------------------------------------------------------- /user/tests/wiring/api/crt.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "testapi.h" 3 | 4 | #include 5 | #include 6 | 7 | // The C-runtime is in some ways also part of our API since coders are relying on it. 8 | // These tests ensure the program successfully links. 9 | 10 | test(sprintf_links) 11 | { 12 | char buf[50]; 13 | API_COMPILE(sprintf(buf,"123")); 14 | API_COMPILE(snprintf(buf, 50, "123")); 15 | } 16 | 17 | -------------------------------------------------------------------------------- /user/tests/wiring/api/fastpin.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "testapi.h" 3 | 4 | 5 | test(api_fastpin) { 6 | 7 | uint8_t value=0; 8 | API_COMPILE(digitalWriteFast(D0, HIGH)); 9 | API_COMPILE(digitalWriteFast(A0, LOW)); 10 | API_COMPILE(pinSetFast(A0)); 11 | API_COMPILE(pinResetFast(A0)); 12 | (void)value++; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /user/tests/wiring/api/i2c.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "testapi.h" 3 | -------------------------------------------------------------------------------- /user/tests/wiring/api/platform.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "testapi.h" 3 | 4 | test(system_ticks) 5 | { 6 | uint32_t value; 7 | API_COMPILE(value=System.ticks()); 8 | API_COMPILE(value=System.ticksPerMicrosecond()); 9 | API_COMPILE(System.ticksDelay(30)); 10 | (void)value; 11 | } -------------------------------------------------------------------------------- /user/tests/wiring/api/pwm.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "testapi.h" 3 | -------------------------------------------------------------------------------- /user/tests/wiring/api/usart.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "testapi.h" 3 | -------------------------------------------------------------------------------- /user/tests/wiring/ble_central_peripheral/ble_central/application.cpp: -------------------------------------------------------------------------------- 1 | #ifndef PARTICLE_TEST_RUNNER 2 | 3 | #include "Particle.h" 4 | #include "unit-test/unit-test.h" 5 | 6 | SYSTEM_MODE(SEMI_AUTOMATIC); 7 | SYSTEM_THREAD(ENABLED); 8 | 9 | UNIT_TEST_APP(); 10 | 11 | #endif // PARTICLE_TEST_RUNNER 12 | -------------------------------------------------------------------------------- /user/tests/wiring/ble_central_peripheral/ble_central/util.h: -------------------------------------------------------------------------------- 1 | ../../ble_common/util.h -------------------------------------------------------------------------------- /user/tests/wiring/ble_central_peripheral/ble_central_peripheral.config.js: -------------------------------------------------------------------------------- 1 | { 2 | "fixtures": [ 3 | { 4 | "name": "ble_central", 5 | "devices": [ 6 | ] 7 | }, 8 | { 9 | "name": "ble_peripheral", 10 | "devices": [ 11 | ] 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /user/tests/wiring/ble_central_peripheral/ble_peripheral/application.cpp: -------------------------------------------------------------------------------- 1 | #ifndef PARTICLE_TEST_RUNNER 2 | 3 | #include "Particle.h" 4 | #include "unit-test/unit-test.h" 5 | 6 | SYSTEM_MODE(SEMI_AUTOMATIC); 7 | SYSTEM_THREAD(ENABLED); 8 | 9 | UNIT_TEST_APP(); 10 | 11 | #endif // PARTICLE_TEST_RUNNER 12 | -------------------------------------------------------------------------------- /user/tests/wiring/ble_central_peripheral/ble_peripheral/util.h: -------------------------------------------------------------------------------- 1 | ../../ble_common/util.h -------------------------------------------------------------------------------- /user/tests/wiring/ble_scanner_broadcaster/ble_broadcaster/application.cpp: -------------------------------------------------------------------------------- 1 | #ifndef PARTICLE_TEST_RUNNER 2 | 3 | #include "Particle.h" 4 | #include "unit-test/unit-test.h" 5 | 6 | SYSTEM_MODE(SEMI_AUTOMATIC); 7 | SYSTEM_THREAD(ENABLED); 8 | 9 | UNIT_TEST_APP(); 10 | 11 | #endif // PARTICLE_TEST_RUNNER 12 | -------------------------------------------------------------------------------- /user/tests/wiring/ble_scanner_broadcaster/ble_broadcaster/util.h: -------------------------------------------------------------------------------- 1 | ../../ble_common/util.h -------------------------------------------------------------------------------- /user/tests/wiring/ble_scanner_broadcaster/ble_scanner/application.cpp: -------------------------------------------------------------------------------- 1 | #ifndef PARTICLE_TEST_RUNNER 2 | 3 | #include "Particle.h" 4 | #include "unit-test/unit-test.h" 5 | 6 | SYSTEM_MODE(SEMI_AUTOMATIC); 7 | SYSTEM_THREAD(ENABLED); 8 | 9 | UNIT_TEST_APP(); 10 | 11 | #endif // PARTICLE_TEST_RUNNER 12 | -------------------------------------------------------------------------------- /user/tests/wiring/ble_scanner_broadcaster/ble_scanner/util.h: -------------------------------------------------------------------------------- 1 | ../../ble_common/util.h -------------------------------------------------------------------------------- /user/tests/wiring/ble_scanner_broadcaster/ble_scanner_broadcaster.config.js: -------------------------------------------------------------------------------- 1 | { 2 | "fixtures": [ 3 | { 4 | "name": "ble_scanner", 5 | "devices": [ 6 | ] 7 | }, 8 | { 9 | "name": "ble_broadcaster", 10 | "devices": [ 11 | ] 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /user/tests/wiring/filesystem/filesystem.spec.js: -------------------------------------------------------------------------------- 1 | suite('POSIX filesystem API'); 2 | 3 | platform('gen3', 'gen4'); 4 | -------------------------------------------------------------------------------- /user/tests/wiring/gen3_invalid_compat_user_app/gen3_invalid_compat_user_app.spec.js: -------------------------------------------------------------------------------- 1 | suite('Gen 3 invalid compat user app'); 2 | 3 | platform('gen3', 'gen4'); 4 | -------------------------------------------------------------------------------- /user/tests/wiring/i2c_master_slave/i2c_master/application.cpp: -------------------------------------------------------------------------------- 1 | #ifndef PARTICLE_TEST_RUNNER 2 | 3 | #include "application.h" 4 | #include "unit-test/unit-test.h" 5 | 6 | SYSTEM_MODE(SEMI_AUTOMATIC); 7 | 8 | UNIT_TEST_APP(); 9 | 10 | #endif // PARTICLE_TEST_RUNNER -------------------------------------------------------------------------------- /user/tests/wiring/i2c_master_slave/i2c_master_slave.config.js: -------------------------------------------------------------------------------- 1 | { 2 | "fixtures": [ 3 | { 4 | "name": "i2c_master", 5 | "devices": [ 6 | ] 7 | }, 8 | { 9 | "name": "i2c_slave", 10 | "devices": [ 11 | ] 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /user/tests/wiring/i2c_master_slave/i2c_master_slave.spec.js: -------------------------------------------------------------------------------- 1 | suite('I2C MASTER SLAVE'); 2 | 3 | platform('gen3', 'p2'); 4 | systemThread('enabled'); 5 | 6 | fixture('i2c_slave', 'i2c_master'); 7 | 8 | // This tag should be filtered out by default 9 | tag('fixture'); -------------------------------------------------------------------------------- /user/tests/wiring/i2c_master_slave/i2c_slave/application.cpp: -------------------------------------------------------------------------------- 1 | #ifndef PARTICLE_TEST_RUNNER 2 | 3 | #include "application.h" 4 | #include "unit-test/unit-test.h" 5 | 6 | SYSTEM_MODE(SEMI_AUTOMATIC); 7 | 8 | UNIT_TEST_APP(); 9 | 10 | #endif // PARTICLE_TEST_RUNNER -------------------------------------------------------------------------------- /user/tests/wiring/i2c_master_slave_old/application.cpp: -------------------------------------------------------------------------------- 1 | #include "application.h" 2 | #include "unit-test/unit-test.h" 3 | 4 | SYSTEM_MODE(SEMI_AUTOMATIC); 5 | 6 | UNIT_TEST_APP(); 7 | -------------------------------------------------------------------------------- /user/tests/wiring/i2c_mcp23017/application.cpp: -------------------------------------------------------------------------------- 1 | #ifndef PARTICLE_TEST_RUNNER 2 | 3 | #include "application.h" 4 | #include "unit-test/unit-test.h" 5 | 6 | UNIT_TEST_APP(); 7 | 8 | SYSTEM_THREAD(ENABLED); 9 | SYSTEM_MODE(AUTOMATIC); 10 | 11 | #endif // PARTICLE_TEST_RUNNER -------------------------------------------------------------------------------- /user/tests/wiring/i2c_mcp23017/i2c_mcp23017.config.js: -------------------------------------------------------------------------------- 1 | { 2 | "fixtures": [ 3 | { 4 | "name": "i2c_mcp23017", 5 | "devices": [ 6 | ] 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /user/tests/wiring/i2c_mcp23017/i2c_mcp23017.spec.js: -------------------------------------------------------------------------------- 1 | suite('I2C MCP23017'); 2 | 3 | platform('p2','argon'); 4 | systemThread('enabled'); 5 | 6 | fixture('i2c_mcp23017'); 7 | 8 | // This tag should be filtered out by default 9 | tag('fixture'); -------------------------------------------------------------------------------- /user/tests/wiring/ledger/application.cpp: -------------------------------------------------------------------------------- 1 | #ifndef PARTICLE_TEST_RUNNER 2 | 3 | #include "application.h" 4 | #include "unit-test/unit-test.h" 5 | 6 | SYSTEM_MODE(SEMI_AUTOMATIC); 7 | 8 | #if USE_THREADING 9 | SYSTEM_THREAD(ENABLED); 10 | #endif 11 | 12 | UNIT_TEST_APP(); 13 | 14 | #endif // !defined(PARTICLE_TEST_RUNNER) 15 | -------------------------------------------------------------------------------- /user/tests/wiring/ledger/ledger.spec.js: -------------------------------------------------------------------------------- 1 | suite('Ledger API'); 2 | 3 | platform('gen3', 'gen4'); 4 | -------------------------------------------------------------------------------- /user/tests/wiring/ledger/test.mk: -------------------------------------------------------------------------------- 1 | ifeq ("${USE_THREADING}","y") 2 | CFLAGS += -DUSE_THREADING=1 3 | else 4 | CFLAGS += -DUSE_THREADING=0 5 | endif 6 | -------------------------------------------------------------------------------- /user/tests/wiring/network_config/network_config.spec.js: -------------------------------------------------------------------------------- 1 | suite('Network config'); 2 | 3 | platform('gen3', 'gen4'); 4 | -------------------------------------------------------------------------------- /user/tests/wiring/networking/application.cpp: -------------------------------------------------------------------------------- 1 | #include "application.h" 2 | #include "unit-test/unit-test.h" 3 | 4 | UNIT_TEST_APP(); 5 | -------------------------------------------------------------------------------- /user/tests/wiring/no_fixture/no_fixture.spec.js: -------------------------------------------------------------------------------- 1 | suite('No fixture'); 2 | 3 | platform('gen3', 'gen4'); 4 | timeout(17 * 60 * 1000); 5 | -------------------------------------------------------------------------------- /user/tests/wiring/no_fixture/readme.md: -------------------------------------------------------------------------------- 1 | ## Flashing the wiring/no_fixture files 2 | 3 | ```none 4 | cd firmware/main 5 | make v=1 TEST=wiring/no_fixture all program-dfu 6 | ``` 7 | -------------------------------------------------------------------------------- /user/tests/wiring/no_fixture/test.include: -------------------------------------------------------------------------------- 1 | -*Brightness* 2 | -*_Ping_* 3 | -------------------------------------------------------------------------------- /user/tests/wiring/no_fixture_ble/no_fixture_ble.spec.js: -------------------------------------------------------------------------------- 1 | suite('No fixture BLE'); 2 | 3 | platform('gen3', 'gen4'); 4 | -------------------------------------------------------------------------------- /user/tests/wiring/no_fixture_cellular/no_fixture_cellular.spec.js: -------------------------------------------------------------------------------- 1 | suite('No fixture cellular'); 2 | 3 | platform('cellular', 'msom'); 4 | -------------------------------------------------------------------------------- /user/tests/wiring/no_fixture_i2c/no_fixture_i2c.spec.js: -------------------------------------------------------------------------------- 1 | suite('No fixture I2C'); 2 | 3 | platform('gen3', 'gen4'); 4 | -------------------------------------------------------------------------------- /user/tests/wiring/no_fixture_spi/no_fixture_spi.spec.js: -------------------------------------------------------------------------------- 1 | suite('No fixture SPI'); 2 | 3 | platform('gen3', 'gen4'); 4 | -------------------------------------------------------------------------------- /user/tests/wiring/no_fixture_stress/no_fixture_stress.spec.js: -------------------------------------------------------------------------------- 1 | suite('No fixture stress'); 2 | 3 | platform('gen3', 'gen4'); 4 | -------------------------------------------------------------------------------- /user/tests/wiring/no_fixture_wifi/no_fixture_wifi.spec.js: -------------------------------------------------------------------------------- 1 | suite('No fixture wifi'); 2 | 3 | // FIXME: tracker should have wifi tag 4 | platform('wifi', 'tracker'); 5 | -------------------------------------------------------------------------------- /user/tests/wiring/persistence/application.cpp: -------------------------------------------------------------------------------- 1 | #include "application.h" 2 | #include "unit-test/unit-test.h" 3 | 4 | SYSTEM_MODE(SEMI_AUTOMATIC) 5 | 6 | #if USE_THREADING == 1 7 | SYSTEM_THREAD(ENABLED) 8 | #endif 9 | 10 | UNIT_TEST_APP() 11 | -------------------------------------------------------------------------------- /user/tests/wiring/persistence/test.mk: -------------------------------------------------------------------------------- 1 | ifeq ("${USE_THREADING}","y") 2 | USE_THREADING_VALUE=1 3 | else 4 | USE_THREADING_VALUE=0 5 | endif 6 | 7 | CFLAGS += -DUSE_THREADING=${USE_THREADING_VALUE} 8 | -------------------------------------------------------------------------------- /user/tests/wiring/serial_halfduplex/application.cpp: -------------------------------------------------------------------------------- 1 | #include "application.h" 2 | #include "unit-test/unit-test.h" 3 | 4 | SYSTEM_MODE(MANUAL); 5 | 6 | UNIT_TEST_APP(); 7 | -------------------------------------------------------------------------------- /user/tests/wiring/serial_loopback/application.cpp: -------------------------------------------------------------------------------- 1 | #ifndef PARTICLE_TEST_RUNNER 2 | 3 | #include "application.h" 4 | #include "unit-test/unit-test.h" 5 | 6 | SYSTEM_MODE(MANUAL); 7 | 8 | UNIT_TEST_APP(); 9 | 10 | #endif // PARTICLE_TEST_RUNNER 11 | -------------------------------------------------------------------------------- /user/tests/wiring/serial_loopback/serial_loopback.config.js: -------------------------------------------------------------------------------- 1 | { 2 | "fixtures": [ 3 | { 4 | "name": "serial_loopback", 5 | "devices": [ 6 | ] 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /user/tests/wiring/serial_loopback/serial_loopback.spec.js: -------------------------------------------------------------------------------- 1 | suite('Serial loopback'); 2 | platform('gen3', 'p2'); 3 | fixture('serial_loopback'); 4 | systemThread('enabled'); 5 | // This tag should be filtered out by default 6 | tag('fixture'); 7 | -------------------------------------------------------------------------------- /user/tests/wiring/serial_loopback2/serial_loopback2.config.js: -------------------------------------------------------------------------------- 1 | { 2 | "fixtures": [ 3 | { 4 | "name": "serial_loopback2", 5 | "devices": [ 6 | ] 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /user/tests/wiring/serial_loopback2/serial_loopback2.spec.js: -------------------------------------------------------------------------------- 1 | suite('Serial loopback2'); 2 | platform('gen3', 'p2'); 3 | fixture('serial_loopback2'); 4 | systemThread('enabled'); 5 | // This tag should be filtered out by default 6 | tag('fixture'); 7 | -------------------------------------------------------------------------------- /user/tests/wiring/sleep/application.cpp: -------------------------------------------------------------------------------- 1 | #include "application.h" 2 | #include "unit-test/unit-test.h" 3 | 4 | UNIT_TEST_APP(); 5 | -------------------------------------------------------------------------------- /user/tests/wiring/sleep20/sleep20.config.js: -------------------------------------------------------------------------------- 1 | { 2 | "fixtures": [ 3 | { 4 | "name": "sleep20-tester", 5 | "devices": [ 6 | ] 7 | }, 8 | { 9 | "name": "sleep20-device", 10 | "devices": [ 11 | ] 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /user/tests/wiring/spi_master_slave/spi1_master/application.cpp: -------------------------------------------------------------------------------- 1 | #ifndef PARTICLE_TEST_RUNNER 2 | 3 | #include "application.h" 4 | #include "unit-test/unit-test.h" 5 | 6 | SYSTEM_MODE(SEMI_AUTOMATIC); 7 | 8 | UNIT_TEST_APP(); 9 | 10 | #endif // PARTICLE_TEST_RUNNER -------------------------------------------------------------------------------- /user/tests/wiring/spi_master_slave/spi1_slave/application.cpp: -------------------------------------------------------------------------------- 1 | #ifndef PARTICLE_TEST_RUNNER 2 | 3 | #include "application.h" 4 | #include "unit-test/unit-test.h" 5 | 6 | SYSTEM_MODE(SEMI_AUTOMATIC); 7 | 8 | UNIT_TEST_APP(); 9 | 10 | #endif // PARTICLE_TEST_RUNNER -------------------------------------------------------------------------------- /user/tests/wiring/spi_master_slave/spi_master/application.cpp: -------------------------------------------------------------------------------- 1 | #ifndef PARTICLE_TEST_RUNNER 2 | 3 | #include "application.h" 4 | #include "unit-test/unit-test.h" 5 | 6 | SYSTEM_MODE(SEMI_AUTOMATIC); 7 | 8 | UNIT_TEST_APP(); 9 | 10 | #endif // PARTICLE_TEST_RUNNER -------------------------------------------------------------------------------- /user/tests/wiring/spi_master_slave/spi_master_ethernet_concurrency/application.cpp: -------------------------------------------------------------------------------- 1 | #ifndef PARTICLE_TEST_RUNNER 2 | 3 | #include "application.h" 4 | #include "unit-test/unit-test.h" 5 | 6 | SYSTEM_MODE(SEMI_AUTOMATIC); 7 | 8 | UNIT_TEST_APP(); 9 | 10 | #endif // PARTICLE_TEST_RUNNER 11 | -------------------------------------------------------------------------------- /user/tests/wiring/spi_master_slave/spi_master_slave.config.js: -------------------------------------------------------------------------------- 1 | { 2 | "fixtures": [ 3 | { 4 | "name": "spi_master", 5 | "devices": [ 6 | ] 7 | }, 8 | { 9 | "name": "spi1_slave", 10 | "devices": [ 11 | ] 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /user/tests/wiring/spi_master_slave/spi_master_slave.spec.bak2: -------------------------------------------------------------------------------- 1 | suite('SPI MASTER SLAVE'); 2 | 3 | platform('gen3', 'p2'); 4 | systemThread('enabled'); 5 | timeout(20 * 60 * 1000); 6 | 7 | // FIXME: currently no way to define multiple fixture configurations within a test suite 8 | // fixture('spi1_slave', 'spi_master'); // use with spi_master_slave_1_bw.config.js and spi_master_slave_2_bw.config.js 9 | fixture('spi1_slave', 'spi1_master'); // use with spi_master_slave_3_bw.config.js 10 | 11 | // This tag should be filtered out by default 12 | tag('fixture'); -------------------------------------------------------------------------------- /user/tests/wiring/spi_master_slave/spi_master_slave.spec.js: -------------------------------------------------------------------------------- 1 | suite('SPI MASTER SLAVE'); 2 | 3 | platform('gen3', 'p2'); 4 | systemThread('enabled'); 5 | timeout(20 * 60 * 1000); 6 | 7 | // FIXME: currently no way to define multiple fixture configurations within a test suite 8 | fixture('spi1_slave', 'spi_master'); // use with spi_master_slave_1_bw.config.js and spi_master_slave_2_bw.config.js 9 | // fixture('spi1_slave', 'spi1_master'); // use with spi_master_slave_3_bw.config.js 10 | 11 | // This tag should be filtered out by default 12 | tag('fixture'); -------------------------------------------------------------------------------- /user/tests/wiring/spi_master_slave/spi_slave/application.cpp: -------------------------------------------------------------------------------- 1 | #ifndef PARTICLE_TEST_RUNNER 2 | 3 | #include "application.h" 4 | #include "unit-test/unit-test.h" 5 | 6 | SYSTEM_MODE(SEMI_AUTOMATIC); 7 | 8 | UNIT_TEST_APP(); 9 | 10 | #endif // PARTICLE_TEST_RUNNER -------------------------------------------------------------------------------- /user/tests/wiring/spi_master_slave_alt/spi_master/application.cpp: -------------------------------------------------------------------------------- 1 | #include "application.h" 2 | #include "unit-test/unit-test.h" 3 | 4 | SYSTEM_MODE(SEMI_AUTOMATIC); 5 | 6 | UNIT_TEST_APP(); 7 | -------------------------------------------------------------------------------- /user/tests/wiring/spi_master_slave_alt/spi_slave/application.cpp: -------------------------------------------------------------------------------- 1 | #include "application.h" 2 | #include "unit-test/unit-test.h" 3 | 4 | SYSTEM_MODE(SEMI_AUTOMATIC); 5 | 6 | UNIT_TEST_APP(); 7 | -------------------------------------------------------------------------------- /user/tests/wiring/spi_shield/application.cpp: -------------------------------------------------------------------------------- 1 | #include "application.h" 2 | #include "unit-test/unit-test.h" 3 | 4 | UNIT_TEST_APP(); 5 | -------------------------------------------------------------------------------- /user/tests/wiring/strformat/strformat.spec.js: -------------------------------------------------------------------------------- 1 | suite('String format'); 2 | 3 | platform('gen3', 'gen4'); 4 | -------------------------------------------------------------------------------- /user/tests/wiring/threading_no_threading_delay/application.cpp: -------------------------------------------------------------------------------- 1 | #include "application.h" 2 | #include "unit-test/unit-test.h" 3 | 4 | UNIT_TEST_APP(); 5 | -------------------------------------------------------------------------------- /user/tests/wiring/time_compat/time_compat.spec.js: -------------------------------------------------------------------------------- 1 | suite('time_t 32/64-bit compatibility'); 2 | 3 | platform('gen3', 'gen4'); 4 | -------------------------------------------------------------------------------- /user/tests/wiring/timer_stress/README.md: -------------------------------------------------------------------------------- 1 | ## Fixture requirements 2 | 3 | This test requires the device under test to be heated above 50°C or below -15°C. 4 | -------------------------------------------------------------------------------- /user/tests/wiring/usbhid/application.cpp: -------------------------------------------------------------------------------- 1 | #include "application.h" 2 | #include "unit-test/unit-test.h" 3 | 4 | UNIT_TEST_APP(); 5 | 6 | SYSTEM_MODE(SEMI_AUTOMATIC); 7 | -------------------------------------------------------------------------------- /user/tests/wiring/usbhid2/application.cpp: -------------------------------------------------------------------------------- 1 | #include "application.h" 2 | #include "unit-test/unit-test.h" 3 | 4 | UNIT_TEST_APP(); 5 | 6 | SYSTEM_MODE(SEMI_AUTOMATIC); 7 | -------------------------------------------------------------------------------- /user/tests/wiring/usbserial/application.cpp: -------------------------------------------------------------------------------- 1 | #include "application.h" 2 | #include "unit-test/unit-test.h" 3 | 4 | UNIT_TEST_APP(); 5 | 6 | SYSTEM_MODE(SEMI_AUTOMATIC); 7 | -------------------------------------------------------------------------------- /user/tests/wiring/watchdog/watchdog.spec.js: -------------------------------------------------------------------------------- 1 | suite('Watchdog'); 2 | 3 | platform('gen3', 'gen4'); 4 | timeout(5 * 60 * 1000); 5 | -------------------------------------------------------------------------------- /user/tests/wiring/wifi/application.cpp: -------------------------------------------------------------------------------- 1 | #include "application.h" 2 | #include "unit-test/unit-test.h" 3 | 4 | UNIT_TEST_APP(); 5 | -------------------------------------------------------------------------------- /user/tests/wiring/wifi_cred_check/application.cpp: -------------------------------------------------------------------------------- 1 | #include "application.h" 2 | #include "unit-test/unit-test.h" 3 | 4 | UNIT_TEST_APP(); 5 | -------------------------------------------------------------------------------- /wiring/.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | 4 | # Libraries 5 | *.lib 6 | *.a 7 | 8 | # Shared objects (inc. Windows DLLs) 9 | *.dll 10 | *.so 11 | *.so.* 12 | *.dylib 13 | 14 | # Executables 15 | *.exe 16 | *.out 17 | *.app 18 | 19 | # Debug folder 20 | Debug/* 21 | 22 | # Release folder 23 | Release/* 24 | 25 | # build folder 26 | *.map 27 | *.lst 28 | *.d 29 | *.o 30 | 31 | # Platform-specific settings 32 | .settings/* 33 | .cproject 34 | .project 35 | .DS_Store 36 | -------------------------------------------------------------------------------- /wiring/import.mk: -------------------------------------------------------------------------------- 1 | WIRING_MODULE_PATH ?= $(PROJECT_ROOT)/wiring 2 | include $(call rwildcard,$(WIRING_MODULE_PATH)/,include.mk) 3 | 4 | WIRING_LIB_DIR = $(BUILD_PATH_BASE)/wiring/$(BUILD_TARGET_PLATFORM) 5 | WIRING_LIB_DEP = $(WIRING_LIB_DIR)/libwiring.a 6 | -------------------------------------------------------------------------------- /wiring/inc/include.mk: -------------------------------------------------------------------------------- 1 | 2 | # Add include to all objects built for this target 3 | INCLUDE_DIRS += $(WIRING_MODULE_PATH)/inc 4 | -------------------------------------------------------------------------------- /wiring/inc/spark_wiring_random.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: spark_wiring_random.h 3 | * Author: mat 4 | * 5 | * Created on 04 September 2014, 21:50 6 | */ 7 | 8 | #ifndef SPARK_WIRING_RANDOM_H 9 | #define SPARK_WIRING_RANDOM_H 10 | 11 | void randomSeed(unsigned int seed); 12 | int random(int max); 13 | int random(int min, int max); 14 | 15 | #endif /* SPARK_WIRING_RANDOM_H */ 16 | 17 | -------------------------------------------------------------------------------- /wiring/makefile: -------------------------------------------------------------------------------- 1 | 2 | MODULE=wiring 3 | WIRING_MODULE_PATH=. 4 | 5 | # Target this makefile is building. 6 | TARGET_TYPE = a 7 | BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM) 8 | 9 | DEPENDENCIES = hal services communication system platform dynalib crypto 10 | 11 | include ../build/arm-tlm.mk 12 | -------------------------------------------------------------------------------- /wiring/src/spark_wiring_random.cpp: -------------------------------------------------------------------------------- 1 | #include "spark_wiring_random.h" 2 | #include 3 | 4 | int random(int max) 5 | { 6 | if (0 == max) { 7 | return 0; 8 | } 9 | return rand() % max; 10 | } 11 | 12 | int random(int min, int max) 13 | { 14 | if (min >= max) { 15 | return min; 16 | } 17 | return random(max - min) + min; 18 | } 19 | 20 | void randomSeed(unsigned int seed) 21 | { 22 | srand(seed); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /wiring_globals/import.mk: -------------------------------------------------------------------------------- 1 | WIRING_GLOBALS_MODULE_PATH ?= $(PROJECT_ROOT)/wiring_globals 2 | include $(call rwildcard,$(WIRING_GLOBALS_MODULE_PATH)/,include.mk) 3 | 4 | WIRING_GLOBALS_LIB_DIR = $(BUILD_PATH_BASE)/wiring_globals/$(BUILD_TARGET_PLATFORM) 5 | WIRING_GLOBALS_LIB_DEP = $(WIRING_GLOBALS_LIB_DIR)/libwiring_globals.a 6 | -------------------------------------------------------------------------------- /wiring_globals/makefile: -------------------------------------------------------------------------------- 1 | 2 | MODULE=wiring_globals 3 | WIRING_GLOBALS_MODULE_PATH=. 4 | 5 | # Target this makefile is building. 6 | TARGET_TYPE = a 7 | BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM) 8 | 9 | # the only true dependency is Wiring, the others are transitive dependencies 10 | DEPENDENCIES = wiring hal services system platform communication crypto dynalib 11 | 12 | include ../build/arm-tlm.mk 13 | -------------------------------------------------------------------------------- /wiring_globals/src/build.mk: -------------------------------------------------------------------------------- 1 | # This file is a makefile included from the top level makefile which 2 | # defines the sources built for the target. 3 | 4 | # Define the prefix to this directory. 5 | # Note: The name must be unique within this build and should be 6 | # based on the root of the project 7 | TARGET_SRC_PATH = src 8 | 9 | # C source files included in this build. 10 | CSRC += 11 | 12 | # enumerate target cpp files 13 | CPPSRC += $(call target_files,src/,*.cpp) 14 | 15 | # ASM source files included in this build. 16 | ASRC += 17 | -------------------------------------------------------------------------------- /wiring_globals/src/wiring_globals_cloud.cpp: -------------------------------------------------------------------------------- 1 | #include "spark_wiring_cloud.h" 2 | 3 | CloudClass Particle; 4 | CloudClass Spark; -------------------------------------------------------------------------------- /wiring_globals/src/wiring_globals_eeprom.cpp: -------------------------------------------------------------------------------- 1 | #include "spark_wiring_eeprom.h" 2 | 3 | // we don't use this global instance since there's no actual instance data 4 | // Having this keeps the unoptimized build happy 5 | 6 | EEPROMClass& __fetch_global_EEPROM() 7 | { 8 | static EEPROMClass eeprom; 9 | return eeprom; 10 | } 11 | -------------------------------------------------------------------------------- /wiring_globals/src/wiring_globals_ipaddress.cpp: -------------------------------------------------------------------------------- 1 | #include "spark_wiring_ipaddress.h" 2 | 3 | #if !HAL_USE_SOCKET_HAL_POSIX 4 | const IPAddress INADDR_NONE(0, 0, 0, 0); 5 | #endif /* !HAL_USE_SOCKET_HAL_POSIX */ 6 | -------------------------------------------------------------------------------- /wiring_globals/src/wiring_globals_spi.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "spark_wiring_spi.h" 4 | #include "core_hal.h" 5 | #include "spark_macros.h" 6 | 7 | #ifndef SPARK_WIRING_NO_SPI 8 | 9 | namespace particle { 10 | namespace globals { 11 | 12 | ::particle::SpiProxy SPI; 13 | 14 | #if Wiring_SPI1 15 | ::particle::SpiProxy SPI1; 16 | #endif // Wiring_SPI1 17 | 18 | #if Wiring_SPI2 19 | ::particle::SpiProxy SPI2; 20 | #endif // Wiring_SPI2 21 | 22 | } } // particle::globals 23 | 24 | #endif //SPARK_WIRING_NO_SPI 25 | --------------------------------------------------------------------------------