File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
ports/esp32s2/common-hal/neopixel_write Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 41
41
*/
42
42
43
43
#include "py/mphal.h"
44
+ #include "py/runtime.h"
44
45
#include "shared-bindings/neopixel_write/__init__.h"
45
46
#include "driver/rmt.h"
46
47
#include "rmt.h"
@@ -102,7 +103,7 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout
102
103
// Convert NS timings to ticks
103
104
uint32_t counter_clk_hz = 0 ;
104
105
if (rmt_get_counter_clock (config .channel , & counter_clk_hz ) != ESP_OK ) {
105
- mp_raise_ValueError (translate ("Could not retrieve clock" ));
106
+ mp_raise_RuntimeError (translate ("Could not retrieve clock" ));
106
107
}
107
108
float ratio = (float )counter_clk_hz / 1e9 ;
108
109
ws2812_t0h_ticks = (uint32_t )(ratio * WS2812_T0H_NS );
@@ -115,7 +116,7 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout
115
116
116
117
// Write and wait to finish
117
118
if (rmt_write_sample (config .channel , pixels , (size_t )numBytes , true) != ESP_OK ) {
118
- mp_raise_ValueError (translate ("Input/output error" ));
119
+ mp_raise_RuntimeError (translate ("Input/output error" ));
119
120
}
120
121
rmt_wait_tx_done (config .channel , pdMS_TO_TICKS (100 ));
121
122
You can’t perform that action at this time.
0 commit comments