Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of football_project by
Diff: proto_code.cpp
- Revision:
- 67:5650f461722a
- Parent:
- 66:18c214707b0c
- Child:
- 70:bd4b1e19a0c6
--- a/proto_code.cpp Tue Jan 19 07:25:15 2016 +0000
+++ b/proto_code.cpp Thu Feb 11 17:47:28 2016 +0000
@@ -298,7 +298,8 @@
m->value = m_in->value;
m->command = 'z';
m->cone = 1;
- ta.send(m);
+ //// ta.send(m);
+ ta.send_immediate(m);
}
timer = millis() - start;
@@ -521,13 +522,13 @@
m->cone = active_cone;
ta.send(m);
- wait_ms(50);
+//// wait_ms(50);
/// wait_ms(300);
m->command = 't';
m->value = (uint32_t)timeout;
ta.send(m);
- wait_ms(50);
+//// wait_ms(50);
/// wait_ms(300);
m->command = 'g';
ta.send(m);
@@ -1167,8 +1168,9 @@
ta.send_immediate(m);
unsigned long st = millis();
+ unsigned long delta = 0L;
+ /* ///
unsigned long current = 0L;
- unsigned long delta = 0L;
if(Dbg)
{
@@ -1210,6 +1212,20 @@
}
wait_us(50);
+ */ ///
+ while( 1 ) ////
+ {
+ delta = millis() - st;
+ if( delta > 50 ) break;
+ ta.spin();
+ if( ta.recieve( m_in ) )
+ {
+ lonely = false;
+ active_cones[m_in->cone] = true;
+ DEBUG( "Reply from cone: %d, %dms\r\n", m_in->cone, delta );
+ break;
+ }
+ }
}
writeToPhone("Available cones are: (1");
