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.
HW05Code/Road.cpp
- Committer:
- MannyK
- Date:
- 2019-10-09
- Revision:
- 0:f17da79e74c9
File content as of revision 0:f17da79e74c9:
#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);
}