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

tests/driver_dac_dds: fix output of sine and saw functions #19251

Merged
merged 1 commit into from
Feb 7, 2023

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Feb 6, 2023

Contribution description

The sine and saw commands have a bug that can lead to either distorted (sine) or no (saw) output.

  • the sine function would overflow to 0 when doing the signed -> unsigned conversion
  • the saw function would produce a step value of 0 if the frequency was too low

Testing procedure

sine in master

bmp_26_000

sine with this PR

bmp_26_001

saw with this PR

bmp_26_002

Issues/PRs references

@benpicco benpicco requested review from gschorcht and maribu February 6, 2023 13:25
@github-actions github-actions bot added the Area: tests Area: tests and testing framework label Feb 6, 2023
@benpicco benpicco added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Feb 6, 2023
@riot-ci
Copy link

riot-ci commented Feb 6, 2023

Murdock results

✔️ PASSED

65fccdd tests/driver_dac_dds: fix output of sine and saw functions

Success Failures Total Runtime
2 0 3 58s

Artifacts

Copy link
Contributor

@gschorcht gschorcht left a comment

Choose a reason for hiding this comment

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

Looks good.

@benpicco
Copy link
Contributor Author

benpicco commented Feb 6, 2023

bors merge

bors bot added a commit that referenced this pull request Feb 6, 2023
17045: sys/coding: add XOR based coding module r=benpicco a=benpicco



19248: cpu/gd32v: add periph_dac support r=benpicco a=gschorcht

### Contribution description

This PR provides the `periph_dac` support for GD32VF103.

### Testing procedure

`tests/periph_dac` should work on `sipeed-longan-nano` port on PA4 and PA5.

### Issues/PRs references

19251: tests/driver_dac_dds: fix output of sine and saw functions r=benpicco a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
@bors
Copy link
Contributor

bors bot commented Feb 6, 2023

This PR was included in a batch that was canceled, it will be automatically retried

@benpicco
Copy link
Contributor Author

benpicco commented Feb 7, 2023

bors merge

bors bot added a commit that referenced this pull request Feb 7, 2023
17045: sys/coding: add XOR based coding module r=benpicco a=benpicco



19251: tests/driver_dac_dds: fix output of sine and saw functions r=benpicco a=benpicco



19254: cpu/gd32v: add periph_rtc_mem support r=benpicco a=gschorcht

### Contribution description

This PR provides the `periph_rtc_mem` support for GD32VF103.

A modified version of this driver could also be used for STM32F1.

### Testing procedure

`tests/periph_rtt` should work on any GD32V board, for example:
```
BOARD=sipeed-longan-nano make -C tests/periph_rtt flash
```
```
Help: Press s to start test, r to print it is ready
START
main(): This is RIOT! (Version: 2023.04-devel-319-gebc86-cpu/gd32v/periph_rtc_mem)

RIOT RTT low-level driver test
RTT configuration:
RTT_MAX_VALUE: 0xffffffff
RTT_FREQUENCY: 32768

Testing the tick conversion
Trying to convert 1 to seconds and back
Trying to convert 256 to seconds and back
Trying to convert 65536 to seconds and back
Trying to convert 16777216 to seconds and back
Trying to convert 2147483648 to seconds and back
All ok

Initializing the RTT driver
RTC mem OK
This test will now display 'Hello' every 5 seconds

RTT now: 1
Setting initial alarm to now + 5 s (163841)
rtt_get_alarm() PASSED
RTC mem OK
```

### Issues/PRs references

Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
@bors
Copy link
Contributor

bors bot commented Feb 7, 2023

Build failed (retrying...):

@bors
Copy link
Contributor

bors bot commented Feb 7, 2023

Build succeeded:

@bors bors bot merged commit af39387 into RIOT-OS:master Feb 7, 2023
@benpicco benpicco deleted the tests/driver_dac_dds-fix branch February 7, 2023 11:04
@MrKevinWeiss MrKevinWeiss added this to the Release 2023.04 milestone Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants