Propeller Code Generator - Now with 14 working Objects
Rayman Posts: 13,010
edited 2021-06-09 14:56 in Propeller 2
Here's a way to jumpstart FlexSpin C development...
Just check a few boxes and hit the "Generate Code" button and this program will generate the barebones .c and .h files and batch files that compile and load it to P2.
You can then compile and load with the other buttons.
Update 09Jun21: Added DVP Camera object!
Now have Object and Pins view working
Check it out... You can test out your VGA or I2C configuration in seconds.
If you don't have FlexProp already, just download latest release from Github and extract into a folder like C:\FlexProp
Then the .exe in the first post should be able to find it and go to work...
Added a Neopixel driver object.
Now, one can generate, compile, and run code to drive an led strip in seconds...
Added RTC and NCO objects.
Also, added FlexProp button that opens up flexprop with the .c file that was previously generated.
This looks pretty cool, @Rayman
Thanks @ersmith !
I just added in a Simple Sound object (source from @Ahle2). Can now get .mod music and sound effects working with just a few clicks.
Also fixed some annoying delays when opening dialog boxes.
Added Servo and Digital I/O objects.
Also, fixed a few things in the code.
@Rayman, this is some really neat stuff. What is this wrtten in and where do you get the time?
Thanks @JRoark . I've spent a lot of time the last 3 weekends working on it. But, I also did a little bit today because I'm finding this useful.
It's a bit experimental, but seems like it's actually working.
It's written in MFC C++, only because that's what I know best. It's also good for making stand alone .exe files with no dependencies.
Just added an object that configures the HUB digital filters.
After looking at this image... Renamed the options from "Enable Filter X" to "Set Filter X". don't know for sure, but imagine that is closer to the truth.
So now, when combined with a digital I/O pin object, one can easily test out these filters.
WOW Ray! This looks fantastic
This is brilliant Ray.
Thanks @Cluso99 & @Coley
I fixed a bad bug in the HUB filters object. I have to remember that the << and >> operator precedence is different in C than in Spin...
Also added icons to the Object Select dialog. Also added a DAC object. This one just sets the 8-bit value non-smart value, not the 16-bit smart mode value.
Really excellent stuff here!
One minor issue... When I re-launch P2C and start a new project, it would be nice if my settings for the paths to flexspin, loadp2, Plan9 directories were saved. I keep my flexprop directory in a specific place that differs from C:\FlexProp\bin. Just a thought.
Thanks for all your hard work!
@dgately Thanks for trying it!
I'm making it so that when you hit the "Compile" button, it saves all the paths and the custom compiler options so they become the default next time.
Sound right? Hopefully can get this posted soon...
Actually, moved it to the "Generate" button, because this is where they are used... Also, made a note there that one must Generate files again if paths are changed. (That tripped me up for a second...)
@dgately Think path saving should work now.
Also, added an ADC object. Some options are greyed out because I haven't figured out how to make them work yet
Almost... Save the Plan9 folder as well?
@dgately Thanks. Should be all fixed this time.
Found a couple bugs while testing with latest version of FlexSpin... (DAC didn't work unless it was first in list and simple sound didn't release pins when deleted). There's a new version in top post.
Added SINC2 and SINC3 options to the ADC object. Also now allows to show calibrated or uncalibrated result.
Note: code for USB is not yet done.
Added the @garryj USB Keyboard and/or Mouse driver as an object.
As a suggestion, the error LED is not required, so you could allow -1 with a comment. I think this requires a mod to the object IIRC. There is a version where I allowed the two LEDs to be configured on different pins with respect to the base pin. Don’t recall if I allowed -1. The activity pin is required as it’s a signalling pin between objects.
That's a good suggestion. The power enable option was easy as it is in Spin. But, the error LED function is deep in the assembly part and I'm not 100% sure how to disable it...
What I can do is make a version with the error LED assembly I/O commands commented out. That seems to work.
Done. Now can optionally generate a variation of the USB driver that has all the error LED pin affecting assembly lines commented out.
New option to not use error LED pin is in bottom left corner of dialog.
Very cool! Is there any chance of a Linux version? Just asking!
In theory, it should run under Wine.
Maybe I can test on my Mac.
Wonder if it has to be 64-bit now...
I'm running P2C.exe in a Win10 VM, via Parallels Desktop on macOS. I can even launch it from a macOS window or Dock. It launches WIN10 in Parallels if not already running, when I double-click on the P2C.exe app in a Mac window (nice!).
What this means is that I don't need to install P2C.exe onto the WIN10 drive. This makes it easier to download in Safari, and not worry about copying over to the WIN10 partition/directories in Parallels!
@dgately Is that with Big Sur? I'm upgrading my Mac now to Big Sur... I'm not clear on whether 32-bit Windows apps will run under Parallels still or not...
Also not sure what this means for Wine... Guess I'll try it out...
Trying this 64-bit version with wine64
Yes, Big Sur (11.3)...
@dgately I was also able to get P2C to run under Parallels after a bunch of OS and Parallels updates.
Was also able to get it to run under Wine64. Well sort of...
The file exploring parts don't work. Guess that's one reason why 64-bit is still in development...
Also, flexspin.exe doesn't work. I think that is because it is a 32-bit app.
Was able to get Parallels going in "Coherence" mode, I think what you described above.
There is something strange going on with the Win10 Desktop in Parallels though...
If I save P2C files there, they don't work. But, if I save them in a new folder on the fake C drive, then it works.
Anyway, seems 32-bit is still working under Parallels.