@@ -631,7 +631,9 @@ void NZS::begin(void)
631
631
632
632
// start up the USB serial interface
633
633
// TODO check for power on USB before doing this...
634
+ #ifndef MECHADUINO_HARDWARE
634
635
SerialUSB.begin (SERIAL_BAUD);
636
+ #endif
635
637
636
638
// setup the serial port for syslog
637
639
Serial5.begin (SERIAL_BAUD);
@@ -648,7 +650,7 @@ void NZS::begin(void)
648
650
LOG (" Power up!" );
649
651
pinMode (PIN_USB_PWR, INPUT);
650
652
651
-
653
+ # ifndef MECHADUINO_HARDWARE
652
654
if (digitalRead (PIN_USB_PWR))
653
655
{
654
656
// wait for USB serial port to come alive
@@ -665,6 +667,7 @@ void NZS::begin(void)
665
667
{
666
668
WARNING (" USB Not connected" );
667
669
}
670
+ #endif
668
671
669
672
validateAndInitNVMParams ();
670
673
@@ -701,9 +704,13 @@ void NZS::begin(void)
701
704
// todo we need to handle error on LCD and through command line
702
705
if (STEPCTRL_NO_POWER == stepCtrlError)
703
706
{
704
-
707
+ # ifndef MECHADUINO_HARDWARE
705
708
SerialUSB.println (" Appears that there is no Motor Power" );
706
709
SerialUSB.println (" Connect motor power!" );
710
+ #else
711
+ Serial5.println (" Appears that there is no Motor Power" );
712
+ Serial5.println (" Connect motor power!" );
713
+ #endif
707
714
#ifndef DISABLE_LCD
708
715
Lcd.lcdShow (" Waiting" , " MOTOR" , " POWER" );
709
716
#endif
@@ -716,7 +723,11 @@ void NZS::begin(void)
716
723
717
724
if (STEPCTRL_NO_CAL == stepCtrlError)
718
725
{
726
+ #ifndef MECHADUINO_HARDWARE
719
727
SerialUSB.println (" You need to Calibrate" );
728
+ #else
729
+ Serial5.println (" You need to Calibrate" );
730
+ #endif
720
731
#ifndef DISABLE_LCD
721
732
Lcd.lcdShow (" NOT " , " Calibrated" , " " );
722
733
delay (1000 );
@@ -742,9 +753,15 @@ void NZS::begin(void)
742
753
743
754
if (STEPCTRL_NO_ENCODER == stepCtrlError)
744
755
{
756
+ #ifndef MECHADUINO_HARDWARE
745
757
SerialUSB.println (" AS5047D not working" );
746
758
SerialUSB.println (" try disconnecting power from board for 15+mins" );
747
759
SerialUSB.println (" you might have to short out power pins to ground" );
760
+ #else
761
+ Serial5.println (" AS5047D not working" );
762
+ Serial5.println (" try disconnecting power from board for 15+mins" );
763
+ Serial5.println (" you might have to short out power pins to ground" );
764
+ #endif
748
765
#ifndef DISABLE_LCD
749
766
Lcd.lcdShow (" Encoder" , " Error!" , " REBOOT" );
750
767
#endif
@@ -814,7 +831,9 @@ void printLocation(void)
814
831
n=stepperCtrl.getLocation (&loc);
815
832
i++;
816
833
}
834
+ #ifndef MECHADUINO_HARDWARE
817
835
SerialUSB.write (buf,len);
836
+ #endif
818
837
819
838
// hex write
820
839
// hex write is 29 bytes per tick, @ 6khz this 174000 baud
0 commit comments