Please help modify the library

Please help me modify the library to run on Teensy 4.0
Currently I use this library, but it only works with Teensy 3.2 it doesn’t work with teensy 4.0
I’ve got an Ardunio program to interface the SoftwareSerial from the Mega2560 TX RX pin to the teensy TX and RX to control the Galvo.
I connect Teensy 4.0 to Galvo SINO as follows

  • pin 2: CLOCK+
  • pin 14: SYNC+
  • pin 7: CHAN1+
  • pin 8: CHAN2+
  • pin 6: CLOCK-
  • pin 20: SYNC-
  • pin 21: CHAN1-
  • pin 5: CHAN2-

But currently that library is not compatible with teensy 4.0

Here is the code I wrote on Arduino

#include <XY2_100.h>
#define NUM_AXIS 2
float fraction ;
float steps = 200.0; ///a 200 semesters sin ruido 0.05 configuration 0 delay
float t = (1.0);
const bytes buffSize = 15;
char inputBuffer[buffSize];
const char startMarker = '<';
const char endMarker = '>';
bytesRecvd = 0;
boolean readInProgress = false;
boolean newDataFromPC = false;
float velServoAngle ;
#include <SoftwareSerial.h>
SoftwareSerial mySerial(0, 1);
XY2_100 galvo;
float difference[NUM_AXIS]={ 0.0, 0.0, };
static float destination[NUM_AXIS] = { 0.0, 0.0, };
static float current_position[NUM_AXIS] = { 0.0, 0.0, };
//=============

void setup() {
  Serial.begin(115200);
   mySerial.begin(115200);
    galvo.begin();
    galvo.setXY(0,0);

}

//=============

void loop() {

   //Serial.print("<");
   getDataFromPC();
  
   replyToPC();

}

//=============

void getDataFromPC() {

     // receive data from PC and save it into inputBuffer
    
   if(mySerial.available() > 0) {

     char x = mySerial.read(); //read char from serial
     //Serial.print(mySerial.read());
     if (x == endMarker) { //look for end marker
       readInProgress = false; //if found, set read in progress true (will stop adding new bytes to buffer)
       newDataFromPC = true; //let arduino know that new data is available
       inputBuffer[bytesRecvd] = 0; //clear input buffer
       processData(); // process data in buffer
     }
    
     if(readInProgress) {
       inputBuffer[bytesRecvd] = x; //populate input buffer with bytes
       bytesRecvd++; //increment index
       if (bytesRecvd == buffSize) { //when buffer is full
         bytesRecvd = buffSize - 1; //keep space for end marker
       }
     }

     if (x == startMarker) { // look for start maker
       bytesRecvd = 0; // if found, set byte received to 0
       readInProgress = true; // set read in progress true
     }
   }
}

//=============

void processData() // for data type "<float, float, int>"
{
   char * strtokIndx; // this is used by strtok() as an index <1233,3223>

    strtokIndx = strtok(inputBuffer,","); // get the first part
    destination[0] = atof(strtokIndx); // convert this part to a float

    strtokIndx = strtok(NULL,","); // get the second part(this continues where the previous call left off)
    destination[1] = atof(strtokIndx); // convert this part to a float

    //strtokIndx = strtok(NULL, ","); // get the last part
    //velServoAngle = atoi(strtokIndx); // convert this part to an <1233,3223>integer (string to int)
}

//=============

void replyToPC() {

   if (newDataFromPC) {
     newDataFromPC = false;
  // if( velServoAngle == 1){
     t = 1 ;
     for(int i=0; i < t ; i++) {
    
   //Serial.print("<>");
   //Serial.print(destination[0]);
   //Serial.print(",");
   //Serial.print(destination[1]);
   //Serial.println("<>");
     }
  for (int8_t i=0; i < NUM_AXIS; i++) {
     difference[i] = destination[i] - current_position[i];
    // Serial.println("dif");
      // Serial.print(destination[i]);

   //Serial.print(difference[i]);
   // Serial.println(",");
   }
    for (int s = 1; s <= steps; s++) {
    // Serial.println("paso");
    
    fraction = 1 / steps;
   
    
     for(int8_t i=0; i < NUM_AXIS; i++) {
       destination[i] = current_position[i] + difference[i] * fraction;
      //Serial.println("dety");
   //Serial.println(destination[i]);

   //Serial.print(destination[1]);
    // Serial.println(">");
      
      // Serial.println("out");
     }
    for(int i=0; i < NUM_AXIS; i++) {
    current_position[i]= destination[i] ;
    // Serial.println("curret");
}
    // //////////////////////////////////////
    //Serial.println("set galvo");
    // Serial.println(destination[0]);
    // Serial.println(destination[1]);
     galvo.setSignedXY(destination[0] , destination[1]);
    
   }
   }
  
  // galvo.setSignedXY(destination[0] , destination[1]);
   //delay(2.5);
//}
}

This is the library I want to modify it from 3.2 to Teensy 4.0

See