gnrc/gnrc_netif_hdr_print: printout timestamp if enabled#19589
Merged
bors[bot] merged 1 commit intoRIOT-OS:masterfrom May 15, 2023
Merged
gnrc/gnrc_netif_hdr_print: printout timestamp if enabled#19589bors[bot] merged 1 commit intoRIOT-OS:masterfrom
bors[bot] merged 1 commit intoRIOT-OS:masterfrom
Conversation
benpicco
reviewed
May 12, 2023
| printf("rssi: %d ", (signed) hdr->rssi); | ||
| #if IS_USED(MODULE_GNRC_NETIF_TIMESTAMP) | ||
| /* Only last 32 bits are printed due to printf from avg-libc doesn't support 64-bit values */ | ||
| printf(" timestamp: %" PRIu32" ", (uint32_t) hdr->timestamp); |
Contributor
There was a problem hiding this comment.
How about
Suggested change
| printf(" timestamp: %" PRIu32" ", (uint32_t) hdr->timestamp); | |
| if (hdr->flags & GNRC_NETIF_HDR_FLAGS_TIMESTAMP) { | |
| printf(" timestamp: %" PRIu32".%09" PRIu32" ", hdr->timestamp / NS_PER_SEC, hdr->timestamp % NS_PER_SEC); | |
| } |
Contributor
Author
There was a problem hiding this comment.
This way of printing the value make sense, thank you.
Regarding the flag - I would prefer to print the value independend from the flag. As this print is in any case for testing purposes, it make sense to check how the value changes even if the flag is not set.
3f12c2f to
569f528
Compare
569f528 to
b260744
Compare
b260744 to
61a1bbe
Compare
benpicco
reviewed
May 15, 2023
Signed-off-by: chudov <[email protected]>
61a1bbe to
516df5c
Compare
benpicco
approved these changes
May 15, 2023
Contributor
|
bors merge |
bors bot
added a commit
that referenced
this pull request
May 15, 2023
18056: pkg/cmsis: use unique package for CMSIS headers, DSP and NN modules r=benpicco a=aabadie 19571: cpu/stm32/periph_adc: fixes and improvements for L4 support r=benpicco a=gschorcht ### Contribution description This PR provides the following fixes and improvements for the `periph_adc` implementation for STM32L4. - Support STM32L496AG added. - Instead of defining the number of ADC devices for each MCU model, the number of ADC devices is determined from ADCx definitions in CMSIS header. - MCU specific register/value defines are valid for all L4 MCUs, model based conditional compilation is removed. - The ADC clock disable function is fixed using a counter. The counter is incremented in `prep` and decremented in `done`. The ADC clock is disabled if the counter becomes 0. - For boards that have not connected the V_REF+ pin to an external reference voltage, the VREFBUF peripheral can be used as V_REF+ (if supported) by setting `VREFBUF_ENABLE=1`. - The ASCR register is available and has to be set for all STM32L471xx, STM32L475xx, STM32L476xx, STM32L485xx and STM32L486xx MCUs. Instead of using the CPU model for conditional compilation, the CPU line is used to support all MCU of that lines. - Setting of SQR1 is fixed. Setting the SQR1 did only work before because the `ADC_SRQ_L` is set to 0 for a sequence length of 1. - Setting the `ADC_CCR_CKMODE` did only work for the reset state. It is now cleared before it is set. Instead of using the `ADC_CCR_CKMODE_x` bits to set the mode, the mode defines are used. - Support for V_REFINT as ADC channel added. ### Testing procedure 19589: gnrc/gnrc_netif_hdr_print: printout timestamp if enabled r=benpicco a=chudov Co-authored-by: Alexandre Abadie <[email protected]> Co-authored-by: Gunar Schorcht <[email protected]> Co-authored-by: chudov <[email protected]>
Contributor
|
Build failed (retrying...): |
bors bot
added a commit
that referenced
this pull request
May 15, 2023
19589: gnrc/gnrc_netif_hdr_print: printout timestamp if enabled r=benpicco a=chudov Co-authored-by: chudov <[email protected]>
Contributor
|
bors cancel |
Contributor
|
Canceled. |
Contributor
|
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution description
The
gnrc_netif_hdrdepending on presence of thegnrc_netif_timestampmodule may contain the packet reception timestamp. This PR adds printing of the timestamp in thegnrc_netif_hdr_print.Testing procedure
The
tests\gnrc_netifis used for testing.The
gnrc_netif_timestampmodule is not used.The PKTDUMP printout shall not have timestamp information
~~ SNIP 1 - size: 24 byte, type: NETTYPE_NETIF (-1)<\n>if_pid: 7 rssi: -32714 lqi: 1<\n>flags: 0x0<\n>The
gnrc_netif_timestampmodule is used.The PKTDUMP printout shall have timestamp information
~~ SNIP 1 - size: 32 byte, type: NETTYPE_NETIF (-1)<\n>if_pid: 7 rssi: 12 timestamp: 2147483648 lqi: 6<\n>flags: 0x0<\n>The test was performed on derfmega256 and nrf52840dongle boards.