Pass gamepad to all objects
This commit is contained in:
@@ -15,8 +15,9 @@ Modi& operator++(Modi& m, int) {
|
||||
return m = (m == Modi::TestMode) ? Modi::Off : static_cast<Modi>(static_cast<int>(m)+1);
|
||||
}
|
||||
|
||||
DriveManager::DriveManager(MoveControl *moveControl, bool wifi) {
|
||||
DriveManager::DriveManager(MoveControl *moveControl, Ps3Controller *gamepad, bool wifi) {
|
||||
this->moveControl = moveControl;
|
||||
this->gamepad = gamepad;
|
||||
|
||||
this->spiPort = new SPIClass(HSPI);
|
||||
spiPort->begin(UBLOX_GNSS_SPI_SCK, UBLOX_GNSS_SPI_CIPO, UBLOX_GNSS_SPI_COPI, UBLOX_GNSS_SPI_CS);
|
||||
@@ -65,17 +66,17 @@ void DriveManager::changeModus(Modi modus) {
|
||||
break;
|
||||
|
||||
case Modi::ManualControl: {
|
||||
this->currentModusPtr = new ManualControl(this->moveControl);
|
||||
this->currentModusPtr = new ManualControl(this->moveControl, this->gamepad);
|
||||
}
|
||||
break;
|
||||
|
||||
case Modi::CaptureRoute: {
|
||||
this->currentModusPtr = new CaptureRoute(this->moveControl, this->navigation);
|
||||
this->currentModusPtr = new CaptureRoute(this->moveControl, this->gamepad, this->navigation);
|
||||
}
|
||||
break;
|
||||
|
||||
case Modi::Autopilot: {
|
||||
this->currentModusPtr = new Autopilot(this->moveControl, this->navigation);
|
||||
this->currentModusPtr = new Autopilot(this->moveControl, this->gamepad, this->navigation);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user