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.
Road.h
- Committer:
- mwgold
- Date:
- 2019-11-10
- Revision:
- 0:ca7cb51e9fd1
- Child:
- 1:54512aca944d
File content as of revision 0:ca7cb51e9fd1:
#ifndef _ROAD_H_
#define _ROAD_H_
#include "mbed.h"
#include "AccCar.h"
#define MAX_CARS 5
class AccCar;
class Road {
public:
EventFlags go_flags;
EventFlags done_flags;
int active_cars;
int intersection_car;
Road();
int try_enter_car(int time);
void let_cars_update();
void wait_for_car_update();
int check_exit_cars(int cars[]);
void print_status();
private:
AccCar* last_car;
AccCar* cars[MAX_CARS];
AccCar* pending_car;
int next_release;
int num_cars;
};
#endif
