Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

esp32: Add code for the second parameter of DAC.tone() #65

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions esp32/mods/pybdac.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,16 @@ STATIC mp_obj_t dac_tone(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_a
tone+=125;
pyb_dac_obj[0].tone_step = (tone *(1<<16)) / 8000000 - 1;

}
else {
} else {
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "DAC tone frequency out of range"));
}
uint16_t tone_scale = args[1].u_int;
if (tone_scale >= 0 && tone_scale <= 3) {
self->tone_scale = tone_scale;

} else {
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "DAC tone scale out of range"));
}
self->tone = true;
self->dc_value = 0;

Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy