-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gnrc/gnrc_netif_hdr_print: printout timestamp if enabled #19589
gnrc/gnrc_netif_hdr_print: printout timestamp if enabled #19589
Conversation
@@ -24,6 +24,10 @@ void gnrc_netif_hdr_print(gnrc_netif_hdr_t *hdr) | |||
|
|||
printf("if_pid: %u ", (unsigned) hdr->if_pid); | |||
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about
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); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Signed-off-by: chudov <chudov@gmail.com>
61a1bbe
to
516df5c
Compare
bors merge |
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 <alexandre.abadie@inria.fr> Co-authored-by: Gunar Schorcht <gunar@schorcht.net> Co-authored-by: chudov <chudov@gmail.com>
Build failed (retrying...): |
bors cancel |
Canceled. |
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. |
Contribution description
The
gnrc_netif_hdr
depending on presence of thegnrc_netif_timestamp
module may contain the packet reception timestamp. This PR adds printing of the timestamp in thegnrc_netif_hdr_print
.Testing procedure
The
tests\gnrc_netif
is used for testing.The
gnrc_netif_timestamp
module 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_timestamp
module 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.