Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed-STM32F103C8T6 mbed libuavcan
main.cpp@3:44c673ad1b8d, 2018-04-19 (annotated)
- Committer:
- RuslanUrya
- Date:
- Thu Apr 19 20:27:01 2018 +0000
- Revision:
- 3:44c673ad1b8d
- Parent:
- 2:f35bc063e2ed
- Child:
- 4:05f811770392
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| RuslanUrya | 0:d2cfc47a8e2a | 1 | #include "mbed.h" |
| RuslanUrya | 1:fc1836a2b111 | 2 | #include <libuavcan/libuavcan/include.mk> //core |
| RuslanUrya | 1:fc1836a2b111 | 3 | #include <libuavcan/libuavcan_drivers/stm32/driver/include.mk> //stm32 driver |
| RuslanUrya | 1:fc1836a2b111 | 4 | //#include <libuavcan/libuavcan/dsdl_compiler/setup.py> //run dsdl compiler? |
| RuslanUrya | 2:f35bc063e2ed | 5 | #include "chip.h" //build configuration |
| RuslanUrya | 3:44c673ad1b8d | 6 | #include "libuavcan/libuavcan/include/uavcan/build_config.hpp" //All default configuration options |
| RuslanUrya | 3:44c673ad1b8d | 7 | #include "libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/build_config.hpp" //OS detection; Any General-Purpose timer |
| RuslanUrya | 1:fc1836a2b111 | 8 | |
| RuslanUrya | 3:44c673ad1b8d | 9 | extern uavcan::ICanDriver& getCanDriver(); |
| RuslanUrya | 3:44c673ad1b8d | 10 | extern uavcan::ISystemClock& getSystemClock(); |
| RuslanUrya | 3:44c673ad1b8d | 11 | |
| RuslanUrya | 3:44c673ad1b8d | 12 | const unsigned NodeMemoryPoolSize = 16384; // Need calulate (tutorial 2). |
| RuslanUrya | 3:44c673ad1b8d | 13 | typedef uavcan::Node<NodeMemoryPoolSize> Node; |
| RuslanUrya | 3:44c673ad1b8d | 14 | |
| RuslanUrya | 3:44c673ad1b8d | 15 | static Node& getNode() { |
| RuslanUrya | 3:44c673ad1b8d | 16 | static Node node(getCanDriver(), getSystemClock()); |
| RuslanUrya | 3:44c673ad1b8d | 17 | return node; |
| RuslanUrya | 3:44c673ad1b8d | 18 | } |
| RuslanUrya | 0:d2cfc47a8e2a | 19 | |
| RuslanUrya | 0:d2cfc47a8e2a | 20 | |
| RuslanUrya | 0:d2cfc47a8e2a | 21 | int main() { |
| RuslanUrya | 0:d2cfc47a8e2a | 22 | while(1) { |
| RuslanUrya | 0:d2cfc47a8e2a | 23 | |
| RuslanUrya | 0:d2cfc47a8e2a | 24 | } |
| RuslanUrya | 0:d2cfc47a8e2a | 25 | } |