| peripheral_clock_rate = 72000000 for 72MHz clock and target_bit_rate = 1000000 for 1MHz can, or 72000 and 1000, or...? * clock_gettime(CLOCK_MONOTONIC, &ts): not available, I guess that's socketcan specific? and I guess I'm supposed to replace it e.g. with a timer, right? (that's at least what I've tentatively done). This raises the question: would be 16 bit timer OK? would be 32 bit timer OK? or does it really have to be 64 bit? (I would hope for 32 to be OK) * GIT_HASH: that's actually my main question, it is needed in onTransferReceived(), but not defined, and I have no idea what it could be or should be ??? Lastly, I need to find a solution for how to test things. I know, you're going to suggest Babel, but I'm considering this as the very-last option (quite expensive). I wonder: Would it be somehow possible to (mis)use a pixhawk for some basic testing. I mean, could I connect my node to the pixhawk, and then, maybe by using some nuttx shell commands, see if my node is present or even working properly? Cool work! Cheers, Olli | |
--
You received this message because you are subscribed to the Google Groups "UAVCAN" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uavcan+unsubscribe@googlegroups.com.
To post to this group, send email to uav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/uavcan/6d98fe7a-817d-4db9-aac2-9903e689bd83%40googlegroups.com.
Please observe that the demo application supplied with libcanard is not intended to show you how to write an application, it is intended to demonstrate how to use the library. This implies that you shouldn't just attempt to run it on your embedded system, especially baremetal, it won't work.
> usleep(): It compiles fine, but I don't have threads, so this functions looks very suspicious to me. Should I assume that it will work also in a baremetal setting? (I've never used that function before, and actually wasn't even aware it would > be available for a non-RTOS arm-C config, so, have no idea how it internally works).
This is a very sensible comment, indeed. It would make sense to unify assertion settings with the core. Would you venture to make a pull request? ;)
All units are SI units unless specified otherwise, so Hz. This could also use some extra clarifications - patches are welcome. ;)
The function clock_gettime() comes from the POSIX realtime extensions library. On your platform you should define an alternative implementation yourself. The implementation should return the 64-bit number of microseconds passed since an arbitrary moment in the past. 32 bit is not OK because it will be overflowing about every hour, which is not acceptable.
You might want to have a look at the STM32 timer driver from libuavcan for inspiration - it is very compact and virtually lock-free.
It should define the short hash of the current git commit.
| so far so good, cheers, Olli |
--
You received this message because you are subscribed to the Google Groups "UAVCAN" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uavcan+unsubscribe@googlegroups.com.
To post to this group, send email to uav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/uavcan/9d2d4cda-c71f-48f2-8717-eb496c3a49d5%40googlegroups.com.
The approach you outlined is not flexible enough, as it does not allow to instantiate more than one instance of the library.
You are right, the standard integer types from stdint.h should be used everywhere. I see no pressing need to fix it ASAP, but we would gladly accept a pull request. ;)
> uint8_t: In many places it seems to me that a variable defined as uint8_t could be equally well be a uint16_t. I believe to have found that, at least on the STM32F103, using uint16_t often leads to shorter and faster code. E.g. in canardSTM32Transmit() I would not define tx_mailbox and i as uint8_t but unit16_t. Any reasons not to do so?The reason not to do that is that it might make the code slightly less intelligible, with a very questionable benefit of possibly seeing the code to be smaller and/or faster in some cases.
> in the definition of shouldAcceptTransfer() I find the statement "(void)source_node_id;". What is this good for?Explicitly instructing the compiler that it should not complain about this variable being unused.
> sometimes you have blocks embraced in {} even though there is no syntactic need for it, e.g. in process1HzTasks(). What effect is this supposed to have?Scope limiting. Smaller blocks limit the lifetime and visibility of variables that are defined inside, which reduces the risks of accidentally reusing them unintentionally.
--
You received this message because you are subscribed to the Google Groups "UAVCAN" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uavcan+unsubscribe@googlegroups.com.
To post to this group, send email to uav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/uavcan/d484d0d9-4b6c-482b-95b0-ab74cf7b9740%40googlegroups.com.
The functionality provided by a sleeping routine is invariant to what part of the application it is invoked from; therefore, an external definition should be used instead of pointers.
Most compilers require this warning to be enabled manually. On GCC the flag is "-Wunused-variable".