meier/ReactionWheelHandler #51
@ -588,8 +588,6 @@ void ObjectFactory::produce(void* args){
|
|||||||
RwDefinitions::MAX_REPLY_SIZE, spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback, nullptr);
|
RwDefinitions::MAX_REPLY_SIZE, spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback, nullptr);
|
||||||
auto rw4SpiCookie = new SpiCookie(addresses::RW4, gpioIds::CS_RW4, "/dev/spidev2.0",
|
auto rw4SpiCookie = new SpiCookie(addresses::RW4, gpioIds::CS_RW4, "/dev/spidev2.0",
|
||||||
RwDefinitions::MAX_REPLY_SIZE, spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback, nullptr);
|
RwDefinitions::MAX_REPLY_SIZE, spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback, nullptr);
|
||||||
(void) rw3SpiCookie;
|
|
||||||
(void) rw4SpiCookie;
|
|
||||||
|
|
||||||
auto rwHandler1 = new RwHandler(objects::RW1, objects::SPI_COM_IF, rw1SpiCookie, gpioComIF,
|
auto rwHandler1 = new RwHandler(objects::RW1, objects::SPI_COM_IF, rw1SpiCookie, gpioComIF,
|
||||||
gpioIds::EN_RW1);
|
gpioIds::EN_RW1);
|
||||||
@ -599,9 +597,22 @@ void ObjectFactory::produce(void* args){
|
|||||||
|
|
||||||
auto rwHandler2 = new RwHandler(objects::RW2, objects::SPI_COM_IF, rw2SpiCookie, gpioComIF,
|
auto rwHandler2 = new RwHandler(objects::RW2, objects::SPI_COM_IF, rw2SpiCookie, gpioComIF,
|
||||||
gpioIds::EN_RW2);
|
gpioIds::EN_RW2);
|
||||||
rwHandler2->setStartUpImmediately();
|
// rwHandler2->setStartUpImmediately();
|
||||||
|
(void) rwHandler2;
|
||||||
rw2SpiCookie->setCallbackArgs(rwHandler2);
|
rw2SpiCookie->setCallbackArgs(rwHandler2);
|
||||||
|
|
||||||
|
auto rwHandler3 = new RwHandler(objects::RW3, objects::SPI_COM_IF, rw3SpiCookie, gpioComIF,
|
||||||
|
gpioIds::EN_RW3);
|
||||||
|
// rwHandler3->setStartUpImmediately();
|
||||||
|
(void) rwHandler3;
|
||||||
|
// rw3SpiCookie->setCallbackArgs(rwHandler3);
|
||||||
|
|
||||||
|
auto rwHandler4 = new RwHandler(objects::RW4, objects::SPI_COM_IF, rw4SpiCookie, gpioComIF,
|
||||||
|
gpioIds::EN_RW4);
|
||||||
|
// (void) rwHandler4;
|
||||||
|
rwHandler4->setStartUpImmediately();
|
||||||
|
rw4SpiCookie->setCallbackArgs(rwHandler4);
|
||||||
|
|
||||||
#endif /* TE0720 == 0 */
|
#endif /* TE0720 == 0 */
|
||||||
|
|
||||||
new UdpTmTcBridge(objects::UDP_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR);
|
new UdpTmTcBridge(objects::UDP_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR);
|
||||||
|
@ -232,12 +232,12 @@ void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, int value
|
|||||||
}
|
}
|
||||||
case(gpioIds::CS_RW3): {
|
case(gpioIds::CS_RW3): {
|
||||||
enableRwDecoder();
|
enableRwDecoder();
|
||||||
selectY3();
|
selectY2();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case(gpioIds::CS_RW4): {
|
case(gpioIds::CS_RW4): {
|
||||||
enableRwDecoder();
|
enableRwDecoder();
|
||||||
selectY4();
|
selectY3();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -413,6 +413,18 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) {
|
|||||||
thisSequence->addSlot(objects::RW2, length * 0.6, DeviceHandlerIF::SEND_READ);
|
thisSequence->addSlot(objects::RW2, length * 0.6, DeviceHandlerIF::SEND_READ);
|
||||||
thisSequence->addSlot(objects::RW2, length * 0.8, DeviceHandlerIF::GET_READ);
|
thisSequence->addSlot(objects::RW2, length * 0.8, DeviceHandlerIF::GET_READ);
|
||||||
|
|
||||||
|
thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||||
|
thisSequence->addSlot(objects::RW3, length * 0.2, DeviceHandlerIF::SEND_WRITE);
|
||||||
|
thisSequence->addSlot(objects::RW3, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
||||||
|
thisSequence->addSlot(objects::RW3, length * 0.6, DeviceHandlerIF::SEND_READ);
|
||||||
|
thisSequence->addSlot(objects::RW3, length * 0.8, DeviceHandlerIF::GET_READ);
|
||||||
|
|
||||||
|
thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||||
|
thisSequence->addSlot(objects::RW4, length * 0.2, DeviceHandlerIF::SEND_WRITE);
|
||||||
|
thisSequence->addSlot(objects::RW4, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
||||||
|
thisSequence->addSlot(objects::RW4, length * 0.6, DeviceHandlerIF::SEND_READ);
|
||||||
|
thisSequence->addSlot(objects::RW4, length * 0.8, DeviceHandlerIF::GET_READ);
|
||||||
|
|
||||||
if (thisSequence->checkSequence() != HasReturnvaluesIF::RETURN_OK) {
|
if (thisSequence->checkSequence() != HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::error << "SPI PST initialization failed" << std::endl;
|
sif::error << "SPI PST initialization failed" << std::endl;
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
|
@ -298,7 +298,7 @@ ReturnValue_t RwHandler::checkSpeedAndRampTime(const uint8_t* commandData, size_
|
|||||||
int32_t speed = *commandData << 24 | *(commandData + 1) << 16 | *(commandData + 2) << 8
|
int32_t speed = *commandData << 24 | *(commandData + 1) << 16 | *(commandData + 2) << 8
|
||||||
| *(commandData + 3);
|
| *(commandData + 3);
|
||||||
|
|
||||||
if (speed < -65000 || speed > 65000 || (speed > -1000 && speed < 1000)) {
|
if ((speed < -65000 || speed > 65000 || (speed > -1000 && speed < 1000)) && (speed != 0)) {
|
||||||
sif::error << "RwHandler::checkSpeedAndRampTime: Command has invalid speed" << std::endl;
|
sif::error << "RwHandler::checkSpeedAndRampTime: Command has invalid speed" << std::endl;
|
||||||
return INVALID_SPEED;
|
return INVALID_SPEED;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user