mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-18 17:23:52 +08:00
interrupt endpoint works
This commit is contained in:
@@ -117,18 +117,23 @@ void ICACHE_FLASH_ATTR some_timerfunc(void *arg) {
|
||||
}
|
||||
|
||||
if (i != 0) {
|
||||
espconn_send(&tcp_conn, buf, i*0x10);
|
||||
espconn_send(&inter_conn, buf, i*0x10);
|
||||
}
|
||||
}
|
||||
|
||||
volatile int timer_started = 0;
|
||||
|
||||
void ICACHE_FLASH_ATTR inter_connect_cb(void *arg) {
|
||||
struct espconn *conn = (struct espconn *)arg;
|
||||
espconn_set_opt(&tcp_conn, ESPCONN_NODELAY);
|
||||
|
||||
// setup timer at 200hz
|
||||
// TODO: disable when it runs out
|
||||
os_timer_setfn(&some_timer, (os_timer_func_t *)some_timerfunc, NULL);
|
||||
os_timer_arm(&some_timer, 5, 1);
|
||||
if (!timer_started) {
|
||||
os_timer_setfn(&some_timer, (os_timer_func_t *)some_timerfunc, NULL);
|
||||
os_timer_arm(&some_timer, 5, 1);
|
||||
timer_started = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR wifi_init() {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
import os
|
||||
from panda.lib.panda import Panda
|
||||
import time
|
||||
|
||||
if __name__ == "__main__":
|
||||
if os.getenv("WIFI") is not None:
|
||||
@@ -9,3 +10,12 @@ if __name__ == "__main__":
|
||||
p = Panda()
|
||||
print p.health()
|
||||
|
||||
while 1:
|
||||
# flood
|
||||
p.can_send(0xaa, "\xaa"*8, 0)
|
||||
p.can_send(0xaa, "\xaa"*8, 1)
|
||||
p.can_send(0xaa, "\xaa"*8, 4)
|
||||
time.sleep(0.01)
|
||||
|
||||
print p.can_recv()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user