/*
 * SSL_Display.cpp
 *
 *  Created on: Feb 11, 2024
 *      Author: Gabriel
 */

#include "SSL_Display.hpp"
#include "SSL_GFX.hpp"

SSL_Display::SSL_Display(ILI9341* hDisplay) :
	hDisplay(hDisplay){

}

SSL_Display::~SSL_Display() {

}

int32_t SSL_Display::init() {
	int32_t errors = 0;
	errors += hDisplay->init();
	errors += hDisplay->setBacklight(1);
	RobotStatus status0;
	for(uint32_t i = 0; i<12; i++){
		status0.batteryLevel = ((float)i)/12;
		status0.connected = true;
		status0.robotId = i;
		status0.status = 0;
		status0.team = 0;
		robots[i].setRobotStatus(status0);
	}

	for(uint32_t i = 0; i<12; i++){
		robots[i].draw();
	}
	return errors;
}
