mirror of
https://github.com/cesanta/mongoose.git
synced 2026-12-05 22:08:23 +00:00
Add TinyUSB example
This commit is contained in:
1 parent
6921227ec8
commit
57a5c0ba38
40 files changed
+23502
-313
No files matched your search
@@ -9,6 +9,7 @@ struct mip_spi spi = {
|
||||
[](void *) { digitalWrite(SS_PIN, HIGH); }, // end transaction
|
||||
[](void *, uint8_t c) { return SPI.transfer(c); }, // execute transaction
|
||||
};
|
||||
struct mip_if mif = {.mac = {2, 0, 1, 2, 3, 5}}; // MIP network interface
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
@@ -22,8 +23,6 @@ void setup() {
|
||||
delay(3000);
|
||||
MG_INFO(("Starting TCP/IP stack..."));
|
||||
|
||||
struct mip_if mif = {.mac = {2, 0, 1, 2, 3, 5}};
|
||||
mif.use_dhcp = true;
|
||||
mif.driver = &mip_driver_w5500;
|
||||
mif.driver_data = &spi;
|
||||
mip_init(&mgr, &mif);
|
||||
@@ -32,7 +31,7 @@ void setup() {
|
||||
mg_timer_add(
|
||||
&mgr, 5000, MG_TIMER_REPEAT,
|
||||
[](void *) {
|
||||
MG_INFO(("ethernet: %s", mip_driver_w5500.up(&spi) ? "up" : "down"));
|
||||
MG_INFO(("ethernet: %s", mip_driver_w5500.up(&mif) ? "up" : "down"));
|
||||
},
|
||||
NULL);
|
||||
|
||||
|
||||
Reference in new issue
Block a user