mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-10 16:31:44 +00:00
update stale example
This commit is contained in:
1 parent
2838c85342
commit
4e3e7ac4b2
1 file changed
+7
-1
@@ -12,7 +12,13 @@ struct mg_tcpip_spi spi = {
|
|||||||
NULL, // SPI metadata
|
NULL, // SPI metadata
|
||||||
[](void *) { digitalWrite(SS_PIN, LOW); SPI.beginTransaction(SPISettings()); },
|
[](void *) { digitalWrite(SS_PIN, LOW); SPI.beginTransaction(SPISettings()); },
|
||||||
[](void *) { digitalWrite(SS_PIN, HIGH); SPI.endTransaction(); },
|
[](void *) { digitalWrite(SS_PIN, HIGH); SPI.endTransaction(); },
|
||||||
[](void *, uint8_t c) { return SPI.transfer(c); }, // Execute transaction
|
[](void *, uint8_t *w, uint8_t *r, size_t n) { // Execute transaction
|
||||||
|
while (n--) {
|
||||||
|
uint8_t c = (w != NULL) ? *w++ : 0xFF;
|
||||||
|
uint8_t d = SPI.transfer(c);
|
||||||
|
if (r != NULL) *r++ = d;
|
||||||
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
struct mg_mgr mgr; // Mongoose event manager
|
struct mg_mgr mgr; // Mongoose event manager
|
||||||
struct mg_tcpip_if mif = {.mac = {2, 0, 1, 2, 3, 5}}; // Network interface
|
struct mg_tcpip_if mif = {.mac = {2, 0, 1, 2, 3, 5}}; // Network interface
|
||||||
|
|||||||
Reference in new issue
Block a user