Skip to content

Conversation

@generationmake
Copy link
Contributor

I added functions for custom subjects for the area of unregulated identifiers. There is also an example which allows turn the builtin LED of the Arduino on and off using uavcan.

However there are some drawbacks with these changes:

  • The Subject-IDs are hard coded into the library. This is against the UAVCAN spec which wants them to be configurable. Additionally only one data type per instance is possible.
  • Code-generation by DSDL was not used
  • The datatypes are maybe in the wrong folder
  • By now only two data types are implemented: scalar.Bit.1.0 and scalar.Real32.1.0

generationmake and others added 12 commits December 30, 2020 02:34
* Bit is a primitive type and does not have a fixed port id assigned to its usage. Therefore it needs to be implemented using templates assigning the desired subject id at compile time.
* The existing implementation hard-coded serialisation/deserialisation, this is not necessary since the uavcan C headers for this type exist and can be used.
* Moving Bit.1.0 to the correct spot, that is: uavcan/primitive/scalar.
…ghtmare for potential business adopters if everyone would claim copyright for a couple of files.
Copy link
Member

@aentinger aentinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good morning @generationmake 👋 I've patched your PR up with the necessary changes, please have a look at them as I believe they will further your understanding of the UAVCAN design. Also can you please test with your setup if the LED blinky will still work?

@aentinger
Copy link
Member

@per1234 👋 ☕ Seems a problem with lcov is leading to unit test failure. Could you please take a look at it?

@per1234
Copy link
Contributor

per1234 commented Dec 31, 2020

The "Unit Tests" workflow run failure will be fixed by arduino/cpp-test-action#3

@generationmake
Copy link
Contributor Author

Hi @aentinger
I reviewed your changes and they seem to be reasonable. The blink-example still works.

I also made an extended example with several Subject-IDs and some LEDs and switches. I used the Bit.1.0 to publish and to subscribe.
Everything worked as expected.
So I think we can merge this code and the Bit.1.0 primitive is fully implemented.

@generationmake
Copy link
Contributor Author

keywords needs to be updated.

@aentinger
Copy link
Member

keywords needs to be updated.

Can you do it? I won't get to it until tomorrow and after adding the keyword this PR can be merged.

generationmake and others added 2 commits December 31, 2020 16:25
@codecov-io
Copy link

codecov-io commented Dec 31, 2020

Codecov Report

Merging #59 (643572e) into master (72ec778) will increase coverage by 0.28%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #59      +/-   ##
==========================================
+ Coverage   83.43%   83.71%   +0.28%     
==========================================
  Files          17       18       +1     
  Lines         513      522       +9     
==========================================
+ Hits          428      437       +9     
  Misses         85       85              
Impacted Files Coverage Δ
src/ArduinoO1Heap.cpp 100.00% <ø> (ø)
src/ArduinoUAVCAN.cpp 96.55% <100.00%> (+0.06%) ⬆️
src/ArduinoUAVCAN.ipp 95.45% <100.00%> (+1.01%) ⬆️
src/utility/CritSec-host.cpp 100.00% <100.00%> (ø)
src/utility/LockGuard.h 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c54a208...643572e. Read the comment docs.

@aentinger aentinger merged commit d58e550 into 107-systems:master Dec 31, 2020
@aentinger aentinger changed the title add custom subjects Add Bit.1.0 and LED example Dec 31, 2020
@aentinger aentinger added topic: firmware Code that runs on an embedded system. type: enhancement PR to improve the project. labels Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: firmware Code that runs on an embedded system. type: enhancement PR to improve the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants