Revision 790
add comments for battery prioritization
branches/autonomous_recharging/code/projects/autonomous_recharging/charging_station/charging.c | ||
---|---|---|
382 | 382 |
* Update battery reading of a robot |
383 | 383 |
* |
384 | 384 |
* @param robot the robot to update battery reading |
385 |
* @param battery battery level of that robot |
|
385 | 386 |
**/ |
386 | 387 |
void update_battery(int robot, int battery) |
387 | 388 |
{ |
388 | 389 |
if (robot < robotsSize && robots[robot] != NULL) |
389 | 390 |
robots[robot]->battery = battery; |
390 | 391 |
} |
392 |
|
|
393 |
/** |
|
394 |
* Kick off charging robots for robot with lower battery level |
|
395 |
* |
|
396 |
* @param robot the robot that needs to be charged |
|
397 |
* @param battery battery level of that robot |
|
398 |
**/ |
|
391 | 399 |
void check_battery(int robot, int battery) |
392 | 400 |
{ |
393 | 401 |
if (charging_is_space_available()) return; |
Also available in: Unified diff