Skip to content

Commit 2009aec

Browse files
committed
Merge branch 'main' of github.com:felixerdy/circuitpython
2 parents de93df6 + bbb1a8b commit 2009aec

File tree

4 files changed

+27
-30
lines changed

4 files changed

+27
-30
lines changed

locale/es.po

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2021-01-04 12:55-0600\n"
11-
"PO-Revision-Date: 2021-03-07 15:50+0000\n"
12-
"Last-Translator: Jose David M <[email protected]>\n"
11+
"PO-Revision-Date: 2021-03-12 02:03+0000\n"
12+
"Last-Translator: Alvaro Figueroa <[email protected]>\n"
1313
"Language-Team: \n"
1414
"Language: es\n"
1515
"MIME-Version: 1.0\n"
1616
"Content-Type: text/plain; charset=UTF-8\n"
1717
"Content-Transfer-Encoding: 8bit\n"
1818
"Plural-Forms: nplurals=2; plural=n != 1;\n"
19-
"X-Generator: Weblate 4.5.1\n"
19+
"X-Generator: Weblate 4.5.2-dev\n"
2020

2121
#: main.c
2222
msgid ""
@@ -1836,7 +1836,7 @@ msgstr ""
18361836

18371837
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
18381838
msgid "Pins must be sequential"
1839-
msgstr ""
1839+
msgstr "Los pines deben estar en orden secuencial"
18401840

18411841
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
18421842
msgid "Pins must share PWM slice"
@@ -2142,11 +2142,10 @@ msgid ""
21422142
"enough power for the whole circuit and press reset (after ejecting "
21432143
"CIRCUITPY).\n"
21442144
msgstr ""
2145-
"La alimentación del microntrolador cayó. Asegúrate que tu fuente de "
2145+
"La alimentación del microntrolador bajó. Asegúrate que tu fuente de "
21462146
"alimentación\n"
2147-
"pueda aportar suficiente energía para todo el circuito y presiona reset "
2148-
"(luego de\n"
2149-
"expulsar CIRCUITPY)\n"
2147+
"pueda aportar suficiente energía para todo el circuito y presiona reset ("
2148+
"luego de expulsar CIRCUITPY)\n"
21502149

21512150
#: shared-module/audiomixer/MixerVoice.c
21522151
msgid "The sample's bits_per_sample does not match the mixer's"
@@ -2818,7 +2817,7 @@ msgstr "circulo solo puede ser registrado con un pariente"
28182817

28192818
#: shared-bindings/bitmaptools/__init__.c
28202819
msgid "clip point must be (x,y) tuple"
2821-
msgstr "El punto clip debe ser una tupla (x, y)"
2820+
msgstr "El punto de recorte debe ser una tupla (x, y)"
28222821

28232822
#: shared-bindings/msgpack/ExtType.c
28242823
msgid "code outside range 0~127"
@@ -3842,7 +3841,7 @@ msgstr "presionando ambos botones al inicio.\n"
38423841

38433842
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
38443843
msgid "pull masks conflict with direction masks"
3845-
msgstr ""
3844+
msgstr "máscara de pull en conflicto con máscara de dirección"
38463845

38473846
#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
38483847
msgid "pull_threshold must be between 1 and 32"

ports/esp32s2/common-hal/busio/I2C.c

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ void i2c_reset(void) {
5353
}
5454
}
5555
}
56-
static bool i2c_inited[I2C_NUM_MAX];
5756

5857
void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
5958
const mcu_pin_obj_t* scl, const mcu_pin_obj_t* sda, uint32_t frequency, uint32_t timeout) {
@@ -90,10 +89,9 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
9089
#endif
9190

9291

93-
if (xSemaphoreCreateBinaryStatic(&self->semaphore) != &self->semaphore) {
92+
if (xSemaphoreCreateMutexStatic(&self->semaphore) != &self->semaphore) {
9493
mp_raise_RuntimeError(translate("Unable to create lock"));
9594
}
96-
xSemaphoreGive(&self->semaphore);
9795
self->sda_pin = sda;
9896
self->scl_pin = scl;
9997
self->i2c_num = I2C_NUM_MAX;
@@ -106,6 +104,10 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
106104
mp_raise_ValueError(translate("All I2C peripherals are in use"));
107105
}
108106
i2c_status[self->i2c_num] = STATUS_IN_USE;
107+
108+
// Delete any previous driver.
109+
i2c_driver_delete(self->i2c_num);
110+
109111
i2c_config_t i2c_conf = {
110112
.mode = I2C_MODE_MASTER,
111113
.sda_io_num = self->sda_pin->number,
@@ -117,23 +119,16 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
117119
.clk_speed = frequency,
118120
}
119121
};
120-
esp_err_t result = i2c_param_config(self->i2c_num, &i2c_conf);
121-
if (result != ESP_OK) {
122-
mp_raise_ValueError(translate("Invalid pins"));
122+
if (i2c_param_config(self->i2c_num, &i2c_conf) != ESP_OK) {
123+
mp_raise_ValueError(translate("Invalid frequency"));
123124
}
124125

125-
126-
if (!i2c_inited[self->i2c_num]) {
127-
result = i2c_driver_install(self->i2c_num,
128-
I2C_MODE_MASTER,
129-
0,
130-
0,
131-
0);
132-
if (result != ESP_OK) {
133-
mp_raise_OSError(MP_EIO);
134-
}
135-
i2c_inited[self->i2c_num] = true;
136-
126+
if (i2c_driver_install(self->i2c_num,
127+
I2C_MODE_MASTER,
128+
0,
129+
0,
130+
0) != ESP_OK) {
131+
mp_raise_OSError(MP_EIO);
137132
}
138133

139134
claim_pin(sda);
@@ -149,12 +144,14 @@ void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) {
149144
return;
150145
}
151146

152-
i2c_status[self->i2c_num] = STATUS_FREE;
147+
i2c_driver_delete(self->i2c_num);
153148

154149
common_hal_reset_pin(self->sda_pin);
155150
common_hal_reset_pin(self->scl_pin);
156151
self->sda_pin = NULL;
157152
self->scl_pin = NULL;
153+
154+
i2c_status[self->i2c_num] = STATUS_FREE;
158155
}
159156

160157
bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) {

ports/esp32s2/common-hal/wifi/__init__.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ void common_hal_wifi_init(void) {
109109

110110
wifi_radio_obj_t* self = &common_hal_wifi_radio_obj;
111111
self->netif = esp_netif_create_default_wifi_sta();
112+
self->started = false;
112113

113114
// Even though we just called esp_netif_create_default_wifi_sta,
114115
// station mode isn't actually ready for use until esp_wifi_set_mode()

ports/esp32s2/esp-idf

0 commit comments

Comments
 (0)