Paradicsom
New Member
Hi,
i need to establish a communication with Hardware-serial.
It is not possible to comile this little code.
Using:
- ESP32 DevModule,
- Arduino ide 2.3.10 (Updates for all Boards and librarys
- B4R 4.0
I hope somebody can help
I get everytime this error-codes (also in older versions):
i need to establish a communication with Hardware-serial.
It is not possible to comile this little code.
Using:
- ESP32 DevModule,
- Arduino ide 2.3.10 (Updates for all Boards and librarys
- B4R 4.0
I hope somebody can help
Test-Application:
#Region Project Attributes
#AutoFlushLogs: True
#CheckArrayBounds: True
#StackBufferSize: 300
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public Serial1 As Serial
'DFÜ mit Nextion
Private SerialNative2 As Stream
Private Stream1 As AsyncStreams
End Sub
#if C
//HardwareSerial Serial2(2); // second Hardware Port
HardwareSerial Serial2(2);
void SerialNative2(B4R::Object* unused) {
::Serial2.begin(9600);
b4r_main::_serialnative2->wrappedStream = &::Serial2;
}
#end if
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
Dim s As String
Log("Stream initialize")
Stream1.Initialize(SerialNative2, "Nextion_NewData", "Nextion_Error")
'Page 1 on Nextion
s = JoinStrings(Array As String("page 1"))
Stream1.Write(s.GetBytes).Write(Array As Byte(0xFF, 0xFF, 0xFF))
End Sub
Sub Nextion_NewData(Buffer() As Byte)
End Sub
Sub Nextion_Error(Buffer() As Byte)
End Sub
I get everytime this error-codes (also in older versions):
Error-Codes:
B4R Version: 4.00
Parse den Code. (0.00s)
Building folders structure. (0.04s)
Kompiliere den Code. (0.01s)
Erstelle Projekt (0.03s)
Compiling (ESP32 Dev Module) Error
F:\B4R\Projekte\ESP-Test\Objects\src\b4r_main.cpp: In static member function 'static void b4r_main::_appstart()':
F:\B4R\Projekte\ESP-Test\Objects\src\b4r_main.cpp:35:31: error: invalid conversion from 'void (*)(B4R::Array*)' to 'B4R::SubVoidVoid' {aka 'void (*)()'} [-fpermissive]
35 | b4r_main::_stream1->Initialize(b4r_main::_serialnative2,_nextion_newdata,_nextion_error);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| void (*)(B4R::Array*)
In file included from F:\B4R\Projekte\ESP-Test\Objects\src\B4RDefines.h:25,
from F:\B4R\Projekte\ESP-Test\Objects\src\b4r_main.cpp:1:
F:\B4R\Projekte\ESP-Test\Objects\src\rRandomAccessFile.h:199:98: note: initializing argument 3 of 'void B4R::AsyncStreams::Initialize(B4R::B4RStream*, B4R::SubVoidArray, B4R::SubVoidVoid)'
199 | void Initialize (B4RStream* Stream, SubVoidArray NewDataSub, SubVoidVoid ErrorSub);
| ~~~~~~~~~~~~^~~~~~~~
Fehler beim Build: exit status 1