Add TinyUSB example

This commit is contained in:
cpq committed 2022-12-19 14:31:54 +00:00
1 parent 6921227ec8
commit 57a5c0ba38
40 files changed
+23502 -313

No files matched your search

+2 -3
View File
@@ -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);