]> granicus.if.org Git - esp-idf/commit
ledc: fix reported error when div_param == 256
authorIvan Grokhotkov <ivan@espressif.com>
Thu, 24 Nov 2016 04:27:32 +0000 (12:27 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Thu, 24 Nov 2016 04:27:32 +0000 (12:27 +0800)
commitf60e54497ceac2eab4da942672fa27e981cb3b62
tree9e8e9e1728c6cc3305ba48b6c1523bb7b31af420
parent137c0272741e0166898f07b104edf8dcce80446d
ledc: fix reported error when div_param == 256

Whenever bit_num and freq_hz are such that div_param == 256, the code would flag that as an error.
In fact, value 256 of div_param was a valid one (HW requires that div_param >= 1.0, when interpreted as a Q10.8 fixed point value).
Changed the if statements a bit to make the logic clearer, and added more descriptive error messages.
Also added missing error for the unimplemented case of low speed mode.
components/driver/ledc.c