Generator error with haxe 4.0.0-preview.5
hxArduino/src/ast2obj/Generator.hx:150: characters 58-67 : Null<haxe.macro.TypedExpr> should be Null<haxe.macro.TConstant>
hxArduino/src/ast2obj/Generator.hx:150: characters 58-67 : For function argument 'c'
Works with haxe 4.0.0-preview.4
Ok, i feel like there are some issues with p5 currently, so hopefully this will be cleared up. I was running p5 and had to downgrade to p4 for a few reasons.
Still happening with haxe 4.0.0 rc3
And with Haxe 4.0.5 - Any fix for this @ianharrigan ? :)
OK, this should be fixed now, thanks for the reminder, id totally forgot about it!
EDIT: ive released haxelib v1.2.0 also....
Ok, thanks! :) But ..trying to compile with Haxe 4.0.5 - creating a new class gives an error :
var myClass = new MyClass();
ast2obj/Generator.hx:150: characters 33-42 : Uncaught exception field access on null
This worked fine with the last version on 4.0.0.p4
right... can you paste the entire source / project?
(including myClass, hxmls, etc)
Its just the blink-01 example with added a new empty class with an empty function in it. Tested it more and the error seems to be related to having parameters with a function:
OK : public function setSomeValue() { }
Creates exception : public function setSomeValue(value:Int) { }
Whoops, yeah... dunno how i didnt catch that... i guess in my dumb tests when i was fixing for haxe4 i only tested with function param defaults (eg: value = 100).. doh
Should be fixed in latest haxelib
Great! Now it compiles without error! :)
But trying to run it gives another problem:
cmd: haxelib run hxArduino --test
Called from hxSerial/Serial.hx line 93
Uncaught exception - load.c(237) : Failed to load library : ./hxSerial.ndll
Where should the ndll be? putting it in the same project or path doesnt help.
im not 100% sure of the internals of hxSerial tbh... not even sure if its haxe4 ready
I dont have an adruino setup to test here myself either...
It worked with Haxe 4.0.0.p4 in the previous version when the ndll was in the same folder i think. But havent been able to run it after the update
i guess, thinking about it, i dont need to have a device to try and connect to it... let me have a go
Yeah, i get the same :/
ok - so it seems to use it we have to revert back to the previous version with haxe 4.0.0p4 then for now...?
well, hxSerial is just used to send it to the device. the output is in build/hxArduino/out... pretty sure there are other ways to get it to the device
https://forum.arduino.cc/index.php?topic=417659.0
if i cant get hxSerial to work, and once i have a device up and running, ill probably remove hxSerial and use one of these methods - feels better / safer...
actually, looking at the source of the run command it isnt for sending it to the device, its to monitor the serial port for debug traces... so maybe this can be removed? Would defo be a shame though as thats useful
Heres the "best" solution ive found so far:
the issue is that neko is 64bit and the hxSerial.dll is 32, ive built a new 64bit hxSerial.ndll, but cant get neko to pick up the correct one (it always seem to be looking in the Windows folder rather than the Windows64 folder), so my advice for now, is drop the attached hxSerial.ndll next to the run.n from this lib, then it should work, ill looking for a better, less manual solution, but at leas this means you can use the run command
Nice, it works perfect - even if its a bit manual!