Hi Team.
Please help me out in understanding the C code conversion engine at present
It seems that only C code that is listed in the FC8 function table can be converted to an Icon /simulated.
C ode that contains general C and access directly to mcu registers can not be converted
or am I understanding this concept wrong. below a block of C code that I am using but it cannot or will not convert to a FC Icon
This in a C code Icon converts to a FC Icon
This does not convert
Thanks for the help as always
C Code conversion to Icon
Moderator: Benj
- Steve
- Matrix Staff
- Posts: 3418
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
Re: C Code conversion to Icon
The C-code conversion does not understand the dot notation (things like T1CONbits.TON) which is why it is failing.
If you first replace the "." with "_" in those 3 lines of C code, then it should partially convert. You will be left with C code statements like "T1CONbits_ON = 0;" which you can change the "_" back to "."
If you first replace the "." with "_" in those 3 lines of C code, then it should partially convert. You will be left with C code statements like "T1CONbits_ON = 0;" which you can change the "_" back to "."
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
- Contact:
Re: C Code conversion to Icon
Hello Steve.
Thank you for your reply.
I have made a simple project and I tried our T1CONbits.TON as you mentioned it seems I am doing something wrong as
flowcode does not understand it ,sorry for my stupidity
Thank you for your reply.
I have made a simple project and I tried our T1CONbits.TON as you mentioned it seems I am doing something wrong as
flowcode does not understand it ,sorry for my stupidity
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
- Steve
- Matrix Staff
- Posts: 3418
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
Re: C Code conversion to Icon
You're not being stupid! There is something a bit strange going on with the way it tries to convert variables it doesn't know about. Also, the workaround I suggested does not fix it, but does allow Flowcode to try to convert what it can (i.e. known variables and C constructs).
Have a look at this project: If you try to convert each C code icon, you'll see the 2nd and 3rd ones seem not to work. But these have just a single line of C code preceded by C comments, so the conversion keeps these together. All the other C icons do convert what they can, but leave the problem lines (e.g. T1CONbits_TON = 0;) as separate C code icons.
Does this help?
Have a look at this project: If you try to convert each C code icon, you'll see the 2nd and 3rd ones seem not to work. But these have just a single line of C code preceded by C comments, so the conversion keeps these together. All the other C icons do convert what they can, but leave the problem lines (e.g. T1CONbits_TON = 0;) as separate C code icons.
Does this help?
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
- Contact:
Re: C Code conversion to Icon
Hi Steve,
Thank so much yes it is clear what is happening and it not an big issue or game changer at the moment by uing a mix of the abilities i will get some realistic flowchart
It would be perfect if the converter could converts the bit field(dot notations) and the registers but I guess that is a wish far off
I am happy we saw what is happening
Regards
Thank so much yes it is clear what is happening and it not an big issue or game changer at the moment by uing a mix of the abilities i will get some realistic flowchart
It would be perfect if the converter could converts the bit field(dot notations) and the registers but I guess that is a wish far off
I am happy we saw what is happening
Regards
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
- Steve
- Matrix Staff
- Posts: 3418
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
Re: C Code conversion to Icon
We're looking into it. If it's fairly easy to add, we should be able to get it in to our next release.QMESAR wrote:It would be perfect if the converter could converts the bit field(dot notations) and the registers but I guess that is a wish far off
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
- Contact:
Re: C Code conversion to Icon
Hi Steve,
Wow that would be great ,
Thank you very much for your support today
Wow that would be great ,
Thank you very much for your support today
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR