arduino-libraries / Arduino_MachineControl

GNU Lesser General Public License v2.1
38 stars 29 forks source link

Use the Arduino_MachineControl library on the M4 core of PMC #99

Closed elastra21 closed 1 year ago

elastra21 commented 2 years ago

I sorround the ArduinoRS485 dependency with a

https://github.com/elastra21/Arduino_MachineControl-ArduinoRS485/blob/589becb4a024f9c7922bd5bc9737338d653b702a/src/Arduino_MachineControl.h#L6-L8

and also the COMMClass https://github.com/elastra21/Arduino_MachineControl-ArduinoRS485/blob/589becb4a024f9c7922bd5bc9737338d653b702a/src/Arduino_MachineControl.h#L111-L181

to avoid compilations error and can use the library in both cores.

CLAassistant commented 2 years ago

CLA assistant check
All committers have signed the CLA.

github-actions[bot] commented 2 years ago

Memory usage change @ 589becb4a024f9c7922bd5bc9737338d653b702a

Board flash % RAM for global variables %
arduino:mbed_portenta:envie_m7 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table Board|examples/Analog_Out
flash|%|examples/Analog_Out
RAM for global variables|%|examples/Analog_input/Analog_input_0_10V
flash|%|examples/Analog_input/Analog_input_0_10V
RAM for global variables|%|examples/Analog_input/Analog_input_4_20mA
flash|%|examples/Analog_input/Analog_input_4_20mA
RAM for global variables|%|examples/Analog_input/Analog_input_NTC
flash|%|examples/Analog_input/Analog_input_NTC
RAM for global variables|%|examples/CAN/ReadCan
flash|%|examples/CAN/ReadCan
RAM for global variables|%|examples/CAN/WriteCan
flash|%|examples/CAN/WriteCan
RAM for global variables|%|examples/Digital_output
flash|%|examples/Digital_output
RAM for global variables|%|examples/Digital_programmable/CombinedIOExpander
flash|%|examples/Digital_programmable/CombinedIOExpander
RAM for global variables|%|examples/Digital_programmable/Digital_input
flash|%|examples/Digital_programmable/Digital_input
RAM for global variables|%|examples/Digital_programmable/GPIO_programmable
flash|%|examples/Digital_programmable/GPIO_programmable
RAM for global variables|%|examples/Encoders
flash|%|examples/Encoders
RAM for global variables|%|examples/Ethernet
flash|%|examples/Ethernet
RAM for global variables|%|examples/RS232
flash|%|examples/RS232
RAM for global variables|%|examples/RS485_fullduplex
flash|%|examples/RS485_fullduplex
RAM for global variables|%|examples/RS485_halfduplex
flash|%|examples/RS485_halfduplex
RAM for global variables|%|examples/RTC
flash|%|examples/RTC
RAM for global variables|%|examples/RTC_Alarm
flash|%|examples/RTC_Alarm
RAM for global variables|%|examples/Temp_probes_RTD
flash|%|examples/Temp_probes_RTD
RAM for global variables|%|examples/Temp_probes_Thermocouples
flash|%|examples/Temp_probes_Thermocouples
RAM for global variables|%|examples/USB_host
flash|%|examples/USB_host
RAM for global variables|% -|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|- arduino:mbed_portenta:envie_m7|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0
Click for full report CSV ``` Board,examples/Analog_Out
flash,%,examples/Analog_Out
RAM for global variables,%,examples/Analog_input/Analog_input_0_10V
flash,%,examples/Analog_input/Analog_input_0_10V
RAM for global variables,%,examples/Analog_input/Analog_input_4_20mA
flash,%,examples/Analog_input/Analog_input_4_20mA
RAM for global variables,%,examples/Analog_input/Analog_input_NTC
flash,%,examples/Analog_input/Analog_input_NTC
RAM for global variables,%,examples/CAN/ReadCan
flash,%,examples/CAN/ReadCan
RAM for global variables,%,examples/CAN/WriteCan
flash,%,examples/CAN/WriteCan
RAM for global variables,%,examples/Digital_output
flash,%,examples/Digital_output
RAM for global variables,%,examples/Digital_programmable/CombinedIOExpander
flash,%,examples/Digital_programmable/CombinedIOExpander
RAM for global variables,%,examples/Digital_programmable/Digital_input
flash,%,examples/Digital_programmable/Digital_input
RAM for global variables,%,examples/Digital_programmable/GPIO_programmable
flash,%,examples/Digital_programmable/GPIO_programmable
RAM for global variables,%,examples/Encoders
flash,%,examples/Encoders
RAM for global variables,%,examples/Ethernet
flash,%,examples/Ethernet
RAM for global variables,%,examples/RS232
flash,%,examples/RS232
RAM for global variables,%,examples/RS485_fullduplex
flash,%,examples/RS485_fullduplex
RAM for global variables,%,examples/RS485_halfduplex
flash,%,examples/RS485_halfduplex
RAM for global variables,%,examples/RTC
flash,%,examples/RTC
RAM for global variables,%,examples/RTC_Alarm
flash,%,examples/RTC_Alarm
RAM for global variables,%,examples/Temp_probes_RTD
flash,%,examples/Temp_probes_RTD
RAM for global variables,%,examples/Temp_probes_Thermocouples
flash,%,examples/Temp_probes_Thermocouples
RAM for global variables,%,examples/USB_host
flash,%,examples/USB_host
RAM for global variables,% arduino:mbed_portenta:envie_m7,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0 ```
facchinm commented 1 year ago

I'd rather fix at core level with something like

diff --git a/variants/PORTENTA_H7_M4/pins_arduino.h b/variants/PORTENTA_H7_M4/pins_arduino.h
index 97a055d4..b99d9cc8 100644
--- a/variants/PORTENTA_H7_M4/pins_arduino.h
+++ b/variants/PORTENTA_H7_M4/pins_arduino.h
@@ -135,6 +135,11 @@ void _ontouch1200bps_();

 #define digitalPinToPort(P)            (digitalPinToPinName(P)/16)

+#define SERIAL_PORT_USBVIRTUAL      Serial
+#define SERIAL_PORT_MONITOR         Serial
+#define SERIAL_PORT_HARDWARE        Serial
+#define SERIAL_PORT_HARDWARE_OPEN   Serial1
+
 #define CRYPTO_WIRE            Wire1

 #endif //__PINS_ARDUINO__
elastra21 commented 1 year ago

@facchinm Well that it'll be a better solution but for now I mean to allow to all the developers keep working would be great to fix that issue even if is a temporal patch. I found the solution months ago and right know that I start to work again with the PMC was complicated to find it again.

facchinm commented 1 year ago

Fixed by https://github.com/arduino/ArduinoCore-mbed/commit/d9ce9420ac44c677ca566d102986f178d25f6839 , will be available in the upcoming core release (3.5.x)