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.
Diff: HW05Code/Road.cpp
- Revision:
- 0:f17da79e74c9
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/HW05Code/Road.cpp Wed Oct 09 16:29:06 2019 +0000
@@ -0,0 +1,25 @@
+#include "Road.h"
+
+Road::Road() {
+ active_cars = 0x00;
+}
+
+void Road::add_car(Car* car) {
+ this->car1 = car;
+
+ active_cars = active_cars | car->flag;
+}
+
+void Road::add_acc_car(AccCar* car) {
+ this->car2 = car;
+
+ active_cars = active_cars | car->flag;
+}
+
+void Road::let_cars_update() {
+ go_flags.set(active_cars);
+}
+
+void Road::wait_for_car_update() {
+ done_flags.wait_all(active_cars);
+}
\ No newline at end of file