Skip to content
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

cpp11-compat: thread::sleep_for in microseconds #19436

Merged
merged 1 commit into from
Apr 17, 2023
Merged

Conversation

kfessel
Copy link
Contributor

@kfessel kfessel commented Mar 30, 2023

Contribution description

after reviewing #19369 i found that there is a conversion to nanoseconds just to convert it to microseconds some instrunctions later for ztimer64_usec to handle it this removes one of the conversions (convert once direct to microseconds)

Testing procedure

run the cpp tests

Issues/PRs references

#19369

@github-actions github-actions bot added the Area: sys Area: System label Mar 30, 2023
@kfessel kfessel changed the title cpp11-compat: thread::sleepfor in microseconds cpp11-compat: thread::sleep_for in microseconds Mar 31, 2023
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 31, 2023
@benpicco benpicco requested a review from kaspar030 March 31, 2023 15:27
@riot-ci
Copy link

riot-ci commented Mar 31, 2023

Murdock results

✔️ PASSED

90d2ae8 cpp11-compat: thread::sleep_for in microseconds

Artifacts

@gschorcht
Copy link
Contributor

bors merge

@bors
Copy link
Contributor

bors bot commented Mar 31, 2023

👎 Rejected by too few approved reviews

@gschorcht
Copy link
Contributor

gschorcht commented Mar 31, 2023

Sorry wrong PR (browser tab 😟).

@kfessel kfessel requested a review from MrKevinWeiss April 17, 2023 10:18
Copy link
Contributor

@MrKevinWeiss MrKevinWeiss left a comment

Choose a reason for hiding this comment

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

It is a nice and valid cleanup and I don't think it is an API change since the units are abstracted.
see:

this_thread::sleep_for(chrono::milliseconds(100));

and

this_thread::sleep_for(chrono::seconds(1));

So I would say ACK, I guess this also protects against setting 0 values?

@kfessel
Copy link
Contributor Author

kfessel commented Apr 17, 2023

I guess this also protects against setting 0 values?

190 in sys/cpp11-compat/include/riot/thread.hpp

and i just saw that there were some spaces missing in that line

@benpicco
Copy link
Contributor

bors merge

bors bot added a commit that referenced this pull request Apr 17, 2023
19411: cpu/gd32v: add riotboot support r=benpicco a=gschorcht

### Contribution description

This PR provides `riotboot` support for GD32V.

### Testing procedure

Use any GD32V board with a JTAG adapter and flash the bootloader:
```python
PROGRAMMER=openocd BOARD=sipeed-longan-nano make -C bootloaders/riotboot flash
```
Flash slot 0 and set `RIOT_VERSION` to 1
```python
USEMODULE=stdio_uart FEATURES_REQUIRED=riotboot RIOT_VERSION=1 \
PROGRAMMER=openocd BOARD=sipeed-longan-nano make -C tests/shell riotboot/flash-slot0
...
### Flashing Target ###
Binfile detected, adding ROM base address: 0x08000000
Flashing with IMAGE_OFFSET: 0x08001000
```
```python
> main(): This is RIOT! (Version: 1)
test_shell.
```
Flash slot 1 and set `RIOT_VERSION` to 2
```python
USEMODULE=stdio_uart FEATURES_REQUIRED=riotboot RIOT_VERSION=2 \
PROGRAMMER=openocd BOARD=sipeed-longan-nano make -C tests/shell riotboot/flash-slot1
...
### Flashing Target ###
Binfile detected, adding ROM base address: 0x08000000
Flashing with IMAGE_OFFSET: 0x08010800
```
```python
> main(): This is RIOT! (Version: 2)
test_shell.
```

### Issues/PRs references


19436: cpp11-compat: thread::sleep_for in microseconds r=benpicco a=kfessel

### Contribution description

after reviewing #19369  i found that there is a conversion to nanoseconds just to convert it to microseconds some instrunctions later for ztimer64_usec to handle it this removes one of the conversions (convert once direct to microseconds)

### Testing procedure

run the cpp tests

### Issues/PRs references

#19369

19450: cpu/esp32: fix compilation issues with GCC 12.2 r=benpicco a=gschorcht

### Contribution description

This PR provides the changes in `cpu/esp32` and `cpu/esp_common` to fix the compilation issues with GCC v12.2.  It is required as the first step in the preparation of the upgrade to ESP-IDF version 5.1.

**Please note**: Insead of fixing the ESP-IDF 4.4 code itself by a big bunch of patches to fix the compilation problems with GCC v12.2, it temporarily disables some warnings. The reason is that the ESP-IDF 5.1 requires GCC v12.2 and should be fixed for this compiler version by the vendor.

### Testing procedure

Green CI

The change were already tested with all ESP-specific modules like `esp_now`, `esp_wifi`, `esp_spi`  and `esp_ble` for all supported ESP platforms.

### Issues/PRs references

Prerequisite for RIOT-OS/riotdocker#227
Fixes issue #19421

19476: native/syscalls: rename real_clock_gettime to clock_gettime r=benpicco a=Teufelchen1

### Contribution description

When compiling RIOT for native using a recent LLVM and enabling ASAN, one might encounter "Duplicated symbol".

This is due to a name clash with `real_clock_gettime()` in compiler-rt from [LLVM](llvm/llvm-project@f50246d), I renamed RIOTs `real_clock_gettime` and just default to the posix function `clock_gettime`. The wrapper existed, most likely, for consistency only.

(The best solution would probably to convince the LLVM folks to declare their symbol as `static` and refactor a bit)

### Testing procedure

Passing CI should be enough.


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
Co-authored-by: Teufelchen1 <bennet.blischke@haw-hamburg.de>
@bors
Copy link
Contributor

bors bot commented Apr 17, 2023

Build failed (retrying...):

@bors
Copy link
Contributor

bors bot commented Apr 17, 2023

Build succeeded:

@bors bors bot merged commit 2b6dc64 into RIOT-OS:master Apr 17, 2023
@benpicco benpicco added this to the Release 2023.07 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants