News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

Positron Studio Update

Started by JohnB, Jul 29, 2021, 08:11 AM

Previous topic - Next topic

atomix

#60
I have a few requests, if this can be done, your IDE will be the best.

1) Expand the number of colors in the settings and the ability to turn off for the selected item (to speed up the drawing of the text)
2) Make in the settings hide the all Toolbars (File, Edit ... )
3) Changing the color of the Gutter element

John Lawton

Hi john,

I've had this slow scrolling issue but it only happens after the program has been running for some time, I don't know whether this indicates a memory leak, but restarting the program clears the issue at least for a while.

John


JohnB

@John Lawton If there are memory leaks, the application should report them on closing.  I don't see that happening here and I haven't had any reports of memory leaks.

@atomix
  • I will investigate the possibility of offering custom edit colours.  I don't think it will be possible to turn off specific items and I doubt it would affect the painting time of the item.
  • I will add a hide Toolbar to the view menu.
  • I could provide an option to set the colour of the Gutter, its just more work. 

All these "minor additions" requested take time and I have spent a huge amount of time on this application with virtually no reward, what donations I have received don't even cover my annual licence costs of development tools and controls I use.
JohnB

John Lawton

#63
Hi John,

new features are great, but to me speed and stability are the most important factors when I'm using an IDE.

I sympathise about all your costs vs income, I'm not sure what the answer is...

Update. Actually I've had some ideas that might be worth consideration. You could make two versions of your IDE, a basic version and a paid-for version with added features, also you could offer to make modifications for payment, so those wishing particular features that might not have majority appeal could get them (sooner) if they paid.

John

JohnB

diebobo has not replied yet to my question on whether the problem exists without code block lines enabled but assuming it is I have a couple of ideas which might speed things up.

I could take Les's approach but it would require maintaining 2 builds I suppose.
JohnB

diebobo

Quote from: JohnB on Nov 26, 2021, 03:06 PMdiebobo has not replied yet to my question on whether the problem exists without code block lines enabled but assuming it is I have a couple of ideas which might speed things up.

I could take Les's approach but it would require maintaining 2 builds I suppose.

Hi John, thanks for your large reply. I will put some effort in to replicate my issue en seen when it occurs. I won't be able to spend decent time until Sunday though.. 

kcsl

@kcsl I can't repeat your white box when saving on my PC maybe its the same issue that @atomix has.
[/quote]

Hi John,

I think I've found the cause... all my programs tend to have a label near the beginning called "DeviceBoot:"... it's the word "Device" that seems to be causing the problem.
An empty file with just this label will demonstrate the issue.

Also, when the option "Show Code block lines" is enabled, the parser likes to put the red squiggles under the word "for" in the following statement:
      SerOut DEBUG_TX, 32, ["Checking for something in speech queue", 13, 10]
I tried replacing the word "for" with other keywords and couldn't find any others until I tried "if", then it got very confused.

Image2.jpg

Regards,
Joe
There's no room for optimism in software or hardware engineering.

JohnB

@diebobo I have made a change which I believe makes the block lines paint more quickly.
I now  only parse the code if there have been changes made to the text.  This does mean that when you make a change there is a small delay before the blocklines update but I am hoping it will make the whole thing quicker when scrolling and also reduce the flicker.

Send me a PM and I will send you a link to try it out.

@kcsl Thank you for isolating the issue and finding another. I should be striping out the comments before it is parsed so am not sure what is causing the second issue. I suspect what is happening on the device issue is that it is partially triggering the device finder.  A dropdown which is triggered on device = nn and will list all the devices filtered by nn.  I'll try and make it less sensitive.
JohnB

kcsl

John,

You're doing a great job with this. As a developer I know how hard to impossible it is to test your own creations in every usage mode, on multiple hardware configurations, on every conceivable operating system version, all loaded will obscure and bizarre applications causing conflicts and heaven knows what other problems, and then throwing it out to a community and crossing your fingers.

Well done.


Kind regards,
Joe
There's no room for optimism in software or hardware engineering.

diebobo

#69
Hi John,

I can replicate the scrolling issie.. Uploaded another video to demonstrate : https://youtu.be/lWB_ViOxcc4

When starting Positron Studion ( the .12 build or .14 build ) and opening that file where scrolling stutter is most notible at that moment stuttering is low ( still annoying though :P ). Butttt, it increases after opening every extra file. My project contains multiple includes and they are listed / opened in tabs on the tab. Scrolling stuttering increasing after opening another TAB on the top. See video.

Extra point to request. If you switch tabs then the code explorer window resets/collapses the tree. I would like to see it saves the state when swithching from / to tabs.

PS: I know how much work it is to develop this kind of software and then equal amount of work finetuning thoose little last tweaks and uhhh request from other users ;).. Just wanted to say that it doesn't go unnoticed..

PS2: That file where the scrolling is most noticeable :

$ifndef ADC_DSPIC33CK_INC
    $define ADC_DSPIC33CK_INC
    '
    '   /\\\\\\\\\
    '  /\\\///////\\\
    '  \/\\\     \/\\\                                                 /\\\          /\\\
    '   \/\\\\\\\\\\\/        /\\\\\     /\\\\\\\\\\     /\\\\\\\\   /\\\\\\\\\\\  /\\\\\\\\\\\  /\\\\\\\\\
    '    \/\\\//////\\\      /\\\///\\\  \/\\\//////    /\\\/////\\\ \////\\\////  \////\\\////  \////////\\\
    '     \/\\\    \//\\\    /\\\  \//\\\ \/\\\\\\\\\\  /\\\\\\\\\\\     \/\\\         \/\\\        /\\\\\\\\\\
    '      \/\\\     \//\\\  \//\\\  /\\\  \////////\\\ \//\\///////      \/\\\ /\\     \/\\\ /\\   /\\\/////\\\
    '       \/\\\      \//\\\  \///\\\\\/    /\\\\\\\\\\  \//\\\\\\\\\\    \//\\\\\      \//\\\\\   \//\\\\\\\\/\\
    '        \///        \///     \/////     \//////////    \//////////      \/////        \/////     \////////\//
    '                                  Let's find out together what makes a PIC Tick!
    '
    ' Experimental ADC library for the dsPIC33xxCK devices
    '
    ' Written for the Positron16 compiler by Les Johnson
    '
    ' Channel availability
    '
    $if (_device = _33CK32MC102) Or (_device = _33CK32MP202) Or (_device = _33CK32MP502)        '
        Or (_device = _33CK64MC102) Or (_device = _33CK64MP202) Or (_device = _33CK64MP502)    '
        Or (_device = _33CK128MP202) Or (_device = _33CK128MP502) Or (_device = _33CK256MP202) '
        Or (_device = _33CK256MP502)
        $define cADC_CHANNEL_COUNT 14

    $elseif (_device = _33CK32MC103) Or (_device = _33CK32MC105) Or (_device = _33CK32MP203)    '
        Or (_device = _33CK32MP503) Or (_device = _33CK64MC103) Or (_device = _33CK64MC105)    '
        Or (_device = _33CK64MP203) Or (_device = _33CK64MP503) Or (_device = _33CK128MP203)   '
        Or (_device = _33CK128MP503) Or (_device = _33CK256MP203) Or (_device = _33CK256MP503)
        $define cADC_CHANNEL_COUNT 18

    $elseif (_device = _33CK32MP102) Or (_device = _33CK32MP103)                                '
        Or (_device = _33CK32MP105) Or (_device = _33CK32MP205) Or (_device = _33CK32MP505)    '
        Or (_device = _33CK64MP102) Or (_device = _33CK64MP103) Or (_device = _33CK64MP105)    '
        Or (_device = _33CK64MP205) Or (_device = _33CK64MP505) Or (_device = _33CK128MP205)   '
        Or (_device = _33CK128MP505) Or (_device = _33CK256MP205) Or (_device = _33CK256MP505)
        $define cADC_CHANNEL_COUNT 21

    $elseif (_device = _33CK32MP206) Or (_device = _33CK32MP506) Or (_device = _33CK64MP206)    '
        Or (_device = _33CK64MP506) Or (_device = _33CK128MP206) Or (_device = _33CK128MP506)  '
        Or (_device = _33CK256MP206) Or (_device = _33CK256MP506)
        $define cADC_CHANNEL_COUNT 22

    $elseif (_device = _33CK256MP305) Or (_device = _33CK256MP605) Or (_device = _33CK512MP305) '
        Or (_device = _33CK512MP605)
        $define cADC_CHANNEL_COUNT 23

    $elseif (_device = _33CK256MP306) Or (_device = _33CK256MP606) Or (_device = _33CK512MP306) '
        Or (_device = _33CK512MP606)
        $define cADC_CHANNEL_COUNT 24

    $elseif (_device = _33CK64MP208) Or (_device = _33CK64MP508) Or (_device = _33CK128MP208)   '
        Or (_device = _33CK128MP508) Or (_device = _33CK256MP208) Or (_device = _33CK256MP508)
        $define cADC_CHANNEL_COUNT 26

    $elseif (_device = _33CK256MP308) Or (_device = _33CK256MP608) Or (_device = _33CK512MP308) '
        Or (_device = _33CK512MP608)
        $define cADC_CHANNEL_COUNT 28

    $else
        $define cADC_CHANNEL_COUNT 0

    $endif

    $if (_device = _33CK32MC102) Or (_device = _33CK32MC103) Or (_device = _33CK32MC105)        '
        Or (_device = _33CK64MC102) Or (_device = _33CK64MC103) Or (_device = _33CK64MC105)
        $define cADC_CHANNEL_MAX 18

    $elseif (_device = _33CK32MP102) Or (_device = _33CK32MP103)                                '
        Or (_device = _33CK32MP105) Or (_device = _33CK64MP102) Or (_device = _33CK64MP103)    '
        Or (_device = _33CK64MP105)
        $define cADC_CHANNEL_MAX 21

    $elseif (_device = _33CK32MP202) Or (_device = _33CK32MP203) Or (_device = _33CK32MP205)    '
        Or (_device = _33CK32MP206) Or (_device = _33CK32MP502) Or (_device = _33CK32MP503)    '
        Or (_device = _33CK32MP505) Or (_device = _33CK32MP506) Or (_device = _33CK64MP202)    '
        Or (_device = _33CK64MP203) Or (_device = _33CK64MP205) Or (_device = _33CK64MP206)    '
        Or (_device = _33CK64MP208) Or (_device = _33CK64MP502) Or (_device = _33CK64MP503)    '
        Or (_device = _33CK64MP505) Or (_device = _33CK64MP506) Or (_device = _33CK64MP508)    '
        Or (_device = _33CK128MP202) Or (_device = _33CK128MP203) Or (_device = _33CK128MP205) '
        Or (_device = _33CK128MP206) Or (_device = _33CK128MP208) Or (_device = _33CK128MP502) '
        Or (_device = _33CK128MP503) Or (_device = _33CK128MP505) Or (_device = _33CK128MP506) '
        Or (_device = _33CK128MP508) Or (_device = _33CK256MP202) Or (_device = _33CK256MP203) '
        Or (_device = _33CK256MP205) Or (_device = _33CK256MP206) Or (_device = _33CK256MP208) '
        Or (_device = _33CK256MP502) Or (_device = _33CK256MP503) Or (_device = _33CK256MP505) '
        Or (_device = _33CK256MP506) Or (_device = _33CK256MP508)
        $define cADC_CHANNEL_MAX 26

    $elseif (_device = _33CK256MP305) Or (_device = _33CK256MP306) Or (_device = _33CK256MP308) '
        Or (_device = _33CK256MP605) Or (_device = _33CK256MP606) Or (_device = _33CK256MP608) '
        Or (_device = _33CK512MP305) Or (_device = _33CK512MP306) Or (_device = _33CK512MP308) '
        Or (_device = _33CK512MP605) Or (_device = _33CK512MP606) Or (_device = _33CK512MP608)
        $define cADC_CHANNEL_MAX 28

    $elseif (_device = _33CK32MC102) Or (_device = _33CK32MC103) Or (_device = _33CK32MC105)    '
        Or (_device = _33CK64MC102) Or (_device = _33CK64MC103) Or (_device = _33CK64MC105)
        $define cADC_CHANNEL_MAX 18

    $elseif (_device = _33CK32MP102) Or (_device = _33CK32MP103) Or (_device = _33CK32MP105)    '
        Or (_device = _33CK64MP102) Or (_device = _33CK64MP103) Or (_device = _33CK64MP105)
        $define cADC_CHANNEL_MAX 21

    $elseif (_device = _33CK32MP202) Or (_device = _33CK32MP203) Or (_device = _33CK32MP205)    '
        Or (_device = _33CK32MP206) Or (_device = _33CK32MP502) Or (_device = _33CK32MP503)    '
        Or (_device = _33CK32MP505) Or (_device = _33CK32MP506) Or (_device = _33CK64MP202)    '
        Or (_device = _33CK64MP203) Or (_device = _33CK64MP205) Or (_device = _33CK64MP206)    '
        Or (_device = _33CK64MP208) Or (_device = _33CK64MP502) Or (_device = _33CK64MP503)    '
        Or (_device = _33CK64MP505) Or (_device = _33CK64MP506) Or (_device = _33CK64MP508)    '
        Or (_device = _33CK128MP202) Or (_device = _33CK128MP203) Or (_device = _33CK128MP205) '
        Or (_device = _33CK128MP206) Or (_device = _33CK128MP208) Or (_device = _33CK128MP502) '
        Or (_device = _33CK128MP503) Or (_device = _33CK128MP505) Or (_device = _33CK128MP506) '
        Or (_device = _33CK128MP508) Or (_device = _33CK256MP202) Or (_device = _33CK256MP203) '
        Or (_device = _33CK256MP205) Or (_device = _33CK256MP206) Or (_device = _33CK256MP208) '
        Or (_device = _33CK256MP502) Or (_device = _33CK256MP503) Or (_device = _33CK256MP505) '
        Or (_device = _33CK256MP506) Or (_device = _33CK256MP508)
        $define cADC_CHANNEL_MAX 26

    $elseif (_device = _33CK256MP305) Or (_device = _33CK256MP306) Or (_device = _33CK256MP308) '
        Or (_device = _33CK256MP605) Or (_device = _33CK256MP606) Or (_device = _33CK256MP608) '
        Or (_device = _33CK512MP305) Or (_device = _33CK512MP306) Or (_device = _33CK512MP308) '
        Or (_device = _33CK512MP605) Or (_device = _33CK512MP606) Or (_device = _33CK512MP608)
        $define cADC_CHANNEL_MAX 28
    $endif

    $if (_device = _33CK256MP305) Or (_device = _33CK256MP306) Or (_device = _33CK256MP308)     '
        Or (_device = _33CK256MP605) Or (_device = _33CK256MP606) Or (_device = _33CK256MP608) '
        Or (_device = _33CK512MP305) Or (_device = _33CK512MP306) Or (_device = _33CK512MP308) '
        Or (_device = _33CK512MP605) Or (_device = _33CK512MP606) Or (_device = _33CK512MP608)
        $define cADC_HAS_CH26
        $define cADC_HAS_CH27
    $endif

    $if (_device = _33CK64MP208) Or (_device = _33CK64MP508) Or (_device = _33CK128MP208)       '
        Or (_device = _33CK128MP508) Or (_device = _33CK256MP208) Or (_device = _33CK256MP308) '
        Or (_device = _33CK256MP508) Or (_device = _33CK256MP608) Or (_device = _33CK512MP308) '
        Or (_device = _33CK512MP608)
        $define cADC_HAS_CH22
        $define cADC_HAS_CH23
    $endif

    $if (_device = _33CK32MP202) Or (_device = _33CK32MP203) Or (_device = _33CK32MP205)        '
        Or (_device = _33CK32MP206) Or (_device = _33CK32MP502) Or (_device = _33CK32MP503)    '
        Or (_device = _33CK32MP505) Or (_device = _33CK32MP506) Or (_device = _33CK64MP202)    '
        Or (_device = _33CK64MP203) Or (_device = _33CK64MP205) Or (_device = _33CK64MP206)    '
        Or (_device = _33CK64MP208) Or (_device = _33CK64MP502) Or (_device = _33CK64MP503)    '
        Or (_device = _33CK64MP505) Or (_device = _33CK64MP506) Or (_device = _33CK64MP508)    '
        Or (_device = _33CK128MP202) Or (_device = _33CK128MP203) Or (_device = _33CK128MP205) '
        Or (_device = _33CK128MP206) Or (_device = _33CK128MP208) Or (_device = _33CK128MP502) '
        Or (_device = _33CK128MP503) Or (_device = _33CK128MP505) Or (_device = _33CK128MP506) '
        Or (_device = _33CK128MP508) Or (_device = _33CK256MP202) Or (_device = _33CK256MP203) '
        Or (_device = _33CK256MP205) Or (_device = _33CK256MP206) Or (_device = _33CK256MP208) '
        Or (_device = _33CK256MP305) Or (_device = _33CK256MP306) Or (_device = _33CK256MP308) '
        Or (_device = _33CK256MP502) Or (_device = _33CK256MP503) Or (_device = _33CK256MP505) '
        Or (_device = _33CK256MP506) Or (_device = _33CK256MP508) Or (_device = _33CK256MP605) '
        Or (_device = _33CK256MP606) Or (_device = _33CK256MP608) Or (_device = _33CK512MP305) '
        Or (_device = _33CK512MP306) Or (_device = _33CK512MP308) Or (_device = _33CK512MP605) '
        Or (_device = _33CK512MP606) Or (_device = _33CK512MP608)
        $define cADC_HAS_CH24
        $define cADC_HAS_CH25
    $endif

    $if (_device = _33CK32MC102) Or (_device = _33CK32MC103)                                    '
        Or (_device = _33CK32MC105) Or (_device = _33CK32MP102) Or (_device = _33CK32MP103)    '
        Or (_device = _33CK32MP105) Or (_device = _33CK32MP205) Or (_device = _33CK32MP206)    '
        Or (_device = _33CK32MP505) Or (_device = _33CK32MP506) Or (_device = _33CK64MC102)    '
        Or (_device = _33CK64MC103) Or (_device = _33CK64MC105) Or (_device = _33CK64MP102)    '
        Or (_device = _33CK64MP103) Or (_device = _33CK64MP105) Or (_device = _33CK64MP205)    '
        Or (_device = _33CK64MP206) Or (_device = _33CK64MP208) Or (_device = _33CK64MP505)    '
        Or (_device = _33CK64MP506) Or (_device = _33CK64MP508) Or (_device = _33CK128MP205)   '
        Or (_device = _33CK128MP206) Or (_device = _33CK128MP208) Or (_device = _33CK128MP505) '
        Or (_device = _33CK128MP506) Or (_device = _33CK128MP508) Or (_device = _33CK256MP205) '
        Or (_device = _33CK256MP206) Or (_device = _33CK256MP208) Or (_device = _33CK256MP305) '
        Or (_device = _33CK256MP306) Or (_device = _33CK256MP308) Or (_device = _33CK256MP505) '
        Or (_device = _33CK256MP506) Or (_device = _33CK256MP508) Or (_device = _33CK256MP605) '
        Or (_device = _33CK256MP606) Or (_device = _33CK256MP608) Or (_device = _33CK512MP305) '
        Or (_device = _33CK512MP306) Or (_device = _33CK512MP308) Or (_device = _33CK512MP605) '
        Or (_device = _33CK512MP606) Or (_device = _33CK512MP608)
        $define cADC_HAS_CH16
    $endif

    $if (_device = _33CK32MC103) Or (_device = _33CK32MC105)                                    '
        Or (_device = _33CK32MP102) Or (_device = _33CK32MP103) Or (_device = _33CK32MP105)     '
        Or (_device = _33CK32MP203) Or (_device = _33CK32MP205) Or (_device = _33CK32MP206)     '
        Or (_device = _33CK32MP503) Or (_device = _33CK32MP505) Or (_device = _33CK32MP506)     '
        Or (_device = _33CK64MC103) Or (_device = _33CK64MC105) Or (_device = _33CK64MP102)     '
        Or (_device = _33CK64MP103) Or (_device = _33CK64MP105) Or (_device = _33CK64MP203)     '
        Or (_device = _33CK64MP205) Or (_device = _33CK64MP206) Or (_device = _33CK64MP208)     '
        Or (_device = _33CK64MP503) Or (_device = _33CK64MP505) Or (_device = _33CK64MP506)     '
        Or (_device = _33CK64MP508) Or (_device = _33CK128MP203) Or (_device = _33CK128MP205)   '
        Or (_device = _33CK128MP206) Or (_device = _33CK128MP208) Or (_device = _33CK128MP503)  '
        Or (_device = _33CK128MP505) Or (_device = _33CK128MP506) Or (_device = _33CK128MP508)  '
        Or (_device = _33CK256MP203) Or (_device = _33CK256MP205) Or (_device = _33CK256MP206)  '
        Or (_device = _33CK256MP208) Or (_device = _33CK256MP305) Or (_device = _33CK256MP306)  '
        Or (_device = _33CK256MP308) Or (_device = _33CK256MP503) Or (_device = _33CK256MP505)  '
        Or (_device = _33CK256MP506) Or (_device = _33CK256MP508) Or (_device = _33CK256MP605)  '
        Or (_device = _33CK256MP606) Or (_device = _33CK256MP608) Or (_device = _33CK512MP305)  '
        Or (_device = _33CK512MP306) Or (_device = _33CK512MP308) Or (_device = _33CK512MP605)  '
        Or (_device = _33CK512MP606) Or (_device = _33CK512MP608)
        $define cADC_HAS_CH15
    $endif

    $if (_device = _33CK32MP102) Or (_device = _33CK32MP103) Or (_device = _33CK32MP105)        '
        Or (_device = _33CK32MP203) Or (_device = _33CK32MP205) Or (_device = _33CK32MP206)     '
        Or (_device = _33CK32MP503) Or (_device = _33CK32MP505) Or (_device = _33CK32MP506)     '
        Or (_device = _33CK64MC103) Or (_device = _33CK64MC105) Or (_device = _33CK64MP102)     '
        Or (_device = _33CK64MP103) Or (_device = _33CK64MP105) Or (_device = _33CK64MP203)     '
        Or (_device = _33CK64MP205) Or (_device = _33CK64MP206) Or (_device = _33CK64MP208)     '
        Or (_device = _33CK64MP503) Or (_device = _33CK64MP505) Or (_device = _33CK64MP506)     '
        Or (_device = _33CK64MP508) Or (_device = _33CK128MP203) Or (_device = _33CK128MP205)   '
        Or (_device = _33CK128MP206) Or (_device = _33CK128MP208) Or (_device = _33CK128MP503)  '
        Or (_device = _33CK128MP505) Or (_device = _33CK128MP506) Or (_device = _33CK128MP508)  '
        Or (_device = _33CK256MP203) Or (_device = _33CK256MP205) Or (_device = _33CK256MP206)  '
        Or (_device = _33CK256MP208) Or (_device = _33CK256MP305) Or (_device = _33CK256MP306)  '
        Or (_device = _33CK256MP308) Or (_device = _33CK256MP503) Or (_device = _33CK256MP505)  '
        Or (_device = _33CK256MP506) Or (_device = _33CK256MP508) Or (_device = _33CK256MP605)  '
        Or (_device = _33CK256MP606) Or (_device = _33CK256MP608) Or (_device = _33CK512MP305)  '
        Or (_device = _33CK512MP306) Or (_device = _33CK512MP308) Or (_device = _33CK512MP605)  '
        Or (_device = _33CK512MP606) Or (_device = _33CK512MP608)
        $define cADC_HAS_CH13
    $endif

    $if (_device = _33CK32MC103) Or (_device = _33CK32MC105)                                    '
        Or (_device = _33CK32MP102) Or (_device = _33CK32MP103) Or (_device = _33CK32MP105)     '
        Or (_device = _33CK32MP203) Or (_device = _33CK32MP205) Or (_device = _33CK32MP206)     '
        Or (_device = _33CK32MP503) Or (_device = _33CK32MP505) Or (_device = _33CK32MP506)     '
        Or (_device = _33CK64MC103) Or (_device = _33CK64MC105) Or (_device = _33CK64MP102)     '
        Or (_device = _33CK64MP103) Or (_device = _33CK64MP105) Or (_device = _33CK64MP203)     '
        Or (_device = _33CK64MP205) Or (_device = _33CK64MP206) Or (_device = _33CK64MP208)     '
        Or (_device = _33CK64MP503) Or (_device = _33CK64MP505) Or (_device = _33CK64MP506)     '
        Or (_device = _33CK64MP508) Or (_device = _33CK128MP203) Or (_device = _33CK128MP205)   '
        Or (_device = _33CK128MP206) Or (_device = _33CK128MP208) Or (_device = _33CK128MP503)  '
        Or (_device = _33CK128MP505) Or (_device = _33CK128MP506) Or (_device = _33CK128MP508)  '
        Or (_device = _33CK256MP203) Or (_device = _33CK256MP205) Or (_device = _33CK256MP206)  '
        Or (_device = _33CK256MP208) Or (_device = _33CK256MP305) Or (_device = _33CK256MP306)  '
        Or (_device = _33CK256MP308) Or (_device = _33CK256MP503) Or (_device = _33CK256MP505)  '
        Or (_device = _33CK256MP506) Or (_device = _33CK256MP508) Or (_device = _33CK256MP605)  '
        Or (_device = _33CK256MP606) Or (_device = _33CK256MP608) Or (_device = _33CK512MP305)  '
        Or (_device = _33CK512MP306) Or (_device = _33CK512MP308) Or (_device = _33CK512MP605)  '
        Or (_device = _33CK512MP606) Or (_device = _33CK512MP608)
        $define cADC_HAS_CH12
    $endif

    $if (_device = _33CK32MC102) Or (_device = _33CK32MC103)                                    '
        Or (_device = _33CK32MC105) Or (_device = _33CK32MP102) Or (_device = _33CK32MP103)     '
        Or (_device = _33CK32MP105) Or (_device = _33CK32MP202) Or (_device = _33CK32MP203)     '
        Or (_device = _33CK32MP205) Or (_device = _33CK32MP206) Or (_device = _33CK32MP502)     '
        Or (_device = _33CK32MP503) Or (_device = _33CK32MP505) Or (_device = _33CK32MP506)     '
        Or (_device = _33CK64MC102) Or (_device = _33CK64MC103) Or (_device = _33CK64MC105)     '
        Or (_device = _33CK64MP102) Or (_device = _33CK64MP103) Or (_device = _33CK64MP105)     '
        Or (_device = _33CK64MP202) Or (_device = _33CK64MP203) Or (_device = _33CK64MP205)     '
        Or (_device = _33CK64MP206) Or (_device = _33CK64MP208) Or (_device = _33CK64MP502)     '
        Or (_device = _33CK64MP503) Or (_device = _33CK64MP505) Or (_device = _33CK64MP506)     '
        Or (_device = _33CK64MP508) Or (_device = _33CK128MP202) Or (_device = _33CK128MP203)   '
        Or (_device = _33CK128MP205) Or (_device = _33CK128MP206) Or (_device = _33CK128MP208)  '
        Or (_device = _33CK128MP502) Or (_device = _33CK128MP503) Or (_device = _33CK128MP505)  '
        Or (_device = _33CK128MP506) Or (_device = _33CK128MP508) Or (_device = _33CK256MP202)  '
        Or (_device = _33CK256MP203) Or (_device = _33CK256MP205) Or (_device = _33CK256MP206)  '
        Or (_device = _33CK256MP208) Or (_device = _33CK256MP305) Or (_device = _33CK256MP306)  '
        Or (_device = _33CK256MP308) Or (_device = _33CK256MP502) Or (_device = _33CK256MP503)  '
        Or (_device = _33CK256MP505) Or (_device = _33CK256MP506) Or (_device = _33CK256MP508)  '
        Or (_device = _33CK256MP605) Or (_device = _33CK256MP606) Or (_device = _33CK256MP608)  '
        Or (_device = _33CK512MP305) Or (_device = _33CK512MP306) Or (_device = _33CK512MP308)  '
        Or (_device = _33CK512MP605) Or (_device = _33CK512MP606) Or (_device = _33CK512MP608)
        $define cADC_HAS_CH5
    $endif

    $if (_device = _33CK32MC102) Or (_device = _33CK32MC103)                                    '
        Or (_device = _33CK32MC105) Or (_device = _33CK32MP102) Or (_device = _33CK32MP103)     '
        Or (_device = _33CK32MP105) Or (_device = _33CK32MP205) Or (_device = _33CK32MP206)     '
        Or (_device = _33CK32MP505) Or (_device = _33CK32MP506) Or (_device = _33CK64MC102)     '
        Or (_device = _33CK64MC103) Or (_device = _33CK64MC105) Or (_device = _33CK64MP102)     '
        Or (_device = _33CK64MP103) Or (_device = _33CK64MP105) Or (_device = _33CK64MP205)     '
        Or (_device = _33CK64MP206) Or (_device = _33CK64MP208) Or (_device = _33CK64MP505)     '
        Or (_device = _33CK64MP506) Or (_device = _33CK64MP508) Or (_device = _33CK128MP205)    '
        Or (_device = _33CK128MP206) Or (_device = _33CK128MP208) Or (_device = _33CK128MP505)  '
        Or (_device = _33CK128MP506) Or (_device = _33CK128MP508) Or (_device = _33CK256MP205)  '
        Or (_device = _33CK256MP206) Or (_device = _33CK256MP208) Or (_device = _33CK256MP305)  '
        Or (_device = _33CK256MP306) Or (_device = _33CK256MP308) Or (_device = _33CK256MP505)  '
        Or (_device = _33CK256MP506) Or (_device = _33CK256MP508) Or (_device = _33CK256MP605)  '
        Or (_device = _33CK256MP606) Or (_device = _33CK256MP608) Or (_device = _33CK512MP305)  '
        Or (_device = _33CK512MP306) Or (_device = _33CK512MP308) Or (_device = _33CK512MP605)  '
        Or (_device = _33CK512MP606) Or (_device = _33CK512MP608)
        $define cADC_HAS_CH17
    $endif

    $if (_device = _33CK32MC103) Or (_device = _33CK32MC105)                                    '
        Or (_device = _33CK32MP102) Or (_device = _33CK32MP103) Or (_device = _33CK32MP105)     '
        Or (_device = _33CK32MP203) Or (_device = _33CK32MP205) Or (_device = _33CK32MP206)     '
        Or (_device = _33CK32MP503) Or (_device = _33CK32MP505) Or (_device = _33CK32MP506)     '
        Or (_device = _33CK64MC103) Or (_device = _33CK64MC105) Or (_device = _33CK64MP102)     '
        Or (_device = _33CK64MP103) Or (_device = _33CK64MP105) Or (_device = _33CK64MP203)     '
        Or (_device = _33CK64MP205) Or (_device = _33CK64MP206) Or (_device = _33CK64MP208)     '
        Or (_device = _33CK64MP503) Or (_device = _33CK64MP505) Or (_device = _33CK64MP506)     '
        Or (_device = _33CK64MP508) Or (_device = _33CK128MP203) Or (_device = _33CK128MP205)   '
        Or (_device = _33CK128MP206) Or (_device = _33CK128MP208) Or (_device = _33CK128MP503)  '
        Or (_device = _33CK128MP505) Or (_device = _33CK128MP506) Or (_device = _33CK128MP508)  '
        Or (_device = _33CK256MP203) Or (_device = _33CK256MP205) Or (_device = _33CK256MP206)  '
        Or (_device = _33CK256MP208) Or (_device = _33CK256MP305) Or (_device = _33CK256MP306)  '
        Or (_device = _33CK256MP308) Or (_device = _33CK256MP503) Or (_device = _33CK256MP505)  '
        Or (_device = _33CK256MP506) Or (_device = _33CK256MP508) Or (_device = _33CK256MP605)  '
        Or (_device = _33CK256MP606) Or (_device = _33CK256MP608) Or (_device = _33CK512MP305)  '
        Or (_device = _33CK512MP306) Or (_device = _33CK512MP308) Or (_device = _33CK512MP605)  '
        Or (_device = _33CK512MP606) Or (_device = _33CK512MP608)
        $define cADC_HAS_CH14
    $endif

    $if (_device = _33CK32MC102) Or (_device = _33CK32MC103)                                    '
        Or (_device = _33CK32MC105) Or (_device = _33CK32MP102) Or (_device = _33CK32MP103)     '
        Or (_device = _33CK32MP105) Or (_device = _33CK32MP202) Or (_device = _33CK32MP203)     '
        Or (_device = _33CK32MP205) Or (_device = _33CK32MP206) Or (_device = _33CK32MP502)     '
        Or (_device = _33CK32MP503) Or (_device = _33CK32MP505) Or (_device = _33CK32MP506)     '
        Or (_device = _33CK64MC102) Or (_device = _33CK64MC103) Or (_device = _33CK64MC105)     '
        Or (_device = _33CK64MP102) Or (_device = _33CK64MP103) Or (_device = _33CK64MP105)     '
        Or (_device = _33CK64MP202) Or (_device = _33CK64MP203) Or (_device = _33CK64MP205)     '
        Or (_device = _33CK64MP206) Or (_device = _33CK64MP208) Or (_device = _33CK64MP502)     '
        Or (_device = _33CK64MP503) Or (_device = _33CK64MP505) Or (_device = _33CK64MP506)     '
        Or (_device = _33CK64MP508) Or (_device = _33CK128MP202) Or (_device = _33CK128MP203)   '
        Or (_device = _33CK128MP205) Or (_device = _33CK128MP206) Or (_device = _33CK128MP208)  '
        Or (_device = _33CK128MP502) Or (_device = _33CK128MP503) Or (_device = _33CK128MP505)  '
        Or (_device = _33CK128MP506) Or (_device = _33CK128MP508) Or (_device = _33CK256MP202)  '
        Or (_device = _33CK256MP203) Or (_device = _33CK256MP205) Or (_device = _33CK256MP206)  '
        Or (_device = _33CK256MP208) Or (_device = _33CK256MP305) Or (_device = _33CK256MP306)  '
        Or (_device = _33CK256MP308) Or (_device = _33CK256MP502) Or (_device = _33CK256MP503)  '
        Or (_device = _33CK256MP505) Or (_device = _33CK256MP506) Or (_device = _33CK256MP508)  '
        Or (_device = _33CK256MP605) Or (_device = _33CK256MP606) Or (_device = _33CK256MP608)  '
        Or (_device = _33CK512MP305) Or (_device = _33CK512MP306) Or (_device = _33CK512MP308)  '
        Or (_device = _33CK512MP605) Or (_device = _33CK512MP606) Or (_device = _33CK512MP608)
        $define cADC_HAS_CH8
        $define cADC_HAS_CH9
        $define cADC_HAS_CH10
        $define cADC_HAS_CH11
    $endif

    $if (_device = _33CK64MP208) Or (_device = _33CK64MP508) Or (_device = _33CK128MP208)        '
        Or (_device = _33CK128MP508) Or (_device = _33CK256MP208) Or (_device = _33CK256MP308)  '
        Or (_device = _33CK256MP508) Or (_device = _33CK256MP608) Or (_device = _33CK512MP308)  '
        Or (_device = _33CK512MP608)
        $define cADC_HAS_CH21
    $endif

    $if (_device = _33CK32MP102) Or (_device = _33CK32MP103)                                    '
        Or (_device = _33CK32MP105) Or (_device = _33CK64MP102) Or (_device = _33CK64MP103)     '
        Or (_device = _33CK64MP105) Or (_device = _33CK64MP208) Or (_device = _33CK64MP508)     '
        Or (_device = _33CK128MP208) Or (_device = _33CK128MP508) Or (_device = _33CK256MP208)  '
        Or (_device = _33CK256MP308) Or (_device = _33CK256MP508) Or (_device = _33CK256MP608)  '
        Or (_device = _33CK512MP308) Or (_device = _33CK512MP608)
        $define cADC_HAS_CH20
    $endif

    $if (_device = _33CK32MP102) Or (_device = _33CK32MP103)                                    '
        Or (_device = _33CK32MP105) Or (_device = _33CK32MP206) Or (_device = _33CK32MP506)     '
        Or (_device = _33CK64MP102) Or (_device = _33CK64MP103) Or (_device = _33CK64MP105)     '
        Or (_device = _33CK64MP206) Or (_device = _33CK64MP208) Or (_device = _33CK64MP506)     '
        Or (_device = _33CK64MP508) Or (_device = _33CK128MP206) Or (_device = _33CK128MP208)   '
        Or (_device = _33CK128MP506) Or (_device = _33CK128MP508) Or (_device = _33CK256MP206)  '
        Or (_device = _33CK256MP208) Or (_device = _33CK256MP306) Or (_device = _33CK256MP308)  '
        Or (_device = _33CK256MP506) Or (_device = _33CK256MP508) Or (_device = _33CK256MP606)  '
        Or (_device = _33CK256MP608) Or (_device = _33CK512MP306) Or (_device = _33CK512MP308)  '
        Or (_device = _33CK512MP606) Or (_device = _33CK512MP608)
        $define cADC_HAS_CH19
    $endif

    $if (_device = _33CK32MP102) Or (_device = _33CK32MP103)                                    '
        Or (_device = _33CK32MP105) Or (_device = _33CK32MP205) Or (_device = _33CK32MP206)     '
        Or (_device = _33CK32MP505) Or (_device = _33CK32MP506) Or (_device = _33CK64MP102)     '
        Or (_device = _33CK64MP103) Or (_device = _33CK64MP105) Or (_device = _33CK64MP205)     '
        Or (_device = _33CK64MP206) Or (_device = _33CK64MP208) Or (_device = _33CK64MP505)     '
        Or (_device = _33CK64MP506) Or (_device = _33CK64MP508) Or (_device = _33CK128MP205)    '
        Or (_device = _33CK128MP206) Or (_device = _33CK128MP208) Or (_device = _33CK128MP505)  '
        Or (_device = _33CK128MP506) Or (_device = _33CK128MP508) Or (_device = _33CK256MP205)  '
        Or (_device = _33CK256MP206) Or (_device = _33CK256MP208) Or (_device = _33CK256MP305)  '
        Or (_device = _33CK256MP306) Or (_device = _33CK256MP308) Or (_device = _33CK256MP505)  '
        Or (_device = _33CK256MP506) Or (_device = _33CK256MP508) Or (_device = _33CK256MP605)  '
        Or (_device = _33CK256MP606) Or (_device = _33CK256MP608) Or (_device = _33CK512MP305)  '
        Or (_device = _33CK512MP306) Or (_device = _33CK512MP308) Or (_device = _33CK512MP605)  '
        Or (_device = _33CK512MP606) Or (_device = _33CK512MP608)
        $define cADC_HAS_CH18
    $endif

    $if (_device = _33CK32MC102) Or (_device = _33CK32MC103)                                    '
        Or (_device = _33CK32MC105) Or (_device = _33CK32MP102) Or (_device = _33CK32MP103)     '
        Or (_device = _33CK32MP105) Or (_device = _33CK32MP202) Or (_device = _33CK32MP203)     '
        Or (_device = _33CK32MP205) Or (_device = _33CK32MP206) Or (_device = _33CK32MP502)     '
        Or (_device = _33CK32MP503) Or (_device = _33CK32MP505) Or (_device = _33CK32MP506)     '
        Or (_device = _33CK64MC102) Or (_device = _33CK64MC103) Or (_device = _33CK64MC105)     '
        Or (_device = _33CK64MP102) Or (_device = _33CK64MP103) Or (_device = _33CK64MP105)     '
        Or (_device = _33CK64MP202) Or (_device = _33CK64MP203) Or (_device = _33CK64MP205)     '
        Or (_device = _33CK64MP206) Or (_device = _33CK64MP208) Or (_device = _33CK64MP502)     '
        Or (_device = _33CK64MP503) Or (_device = _33CK64MP505) Or (_device = _33CK64MP506)     '
        Or (_device = _33CK64MP508) Or (_device = _33CK128MP202) Or (_device = _33CK128MP203)   '
        Or (_device = _33CK128MP205) Or (_device = _33CK128MP206) Or (_device = _33CK128MP208)  '
        Or (_device = _33CK128MP502) Or (_device = _33CK128MP503) Or (_device = _33CK128MP505)  '
        Or (_device = _33CK128MP506) Or (_device = _33CK128MP508) Or (_device = _33CK256MP202)  '
        Or (_device = _33CK256MP203) Or (_device = _33CK256MP205) Or (_device = _33CK256MP206)  '
        Or (_device = _33CK256MP208) Or (_device = _33CK256MP305) Or (_device = _33CK256MP306)  '
        Or (_device = _33CK256MP308) Or (_device = _33CK256MP502) Or (_device = _33CK256MP503)  '
        Or (_device = _33CK256MP505) Or (_device = _33CK256MP506) Or (_device = _33CK256MP508)  '
        Or (_device = _33CK256MP605) Or (_device = _33CK256MP606) Or (_device = _33CK256MP608)  '
        Or (_device = _33CK512MP305) Or (_device = _33CK512MP306) Or (_device = _33CK512MP308)  '
        Or (_device = _33CK512MP605) Or (_device = _33CK512MP606) Or (_device = _33CK512MP608)
        $define cADC_HAS_CH0
        $define cADC_HAS_CH1
        $define cADC_HAS_CH2
        $define cADC_HAS_CH3
        $define cADC_HAS_CH4
        $define cADC_HAS_CH6
        $define cADC_HAS_CH7
    $endif

    '-------------------------------------------------------------------------------------------------------------
    ' ADC cores available
    '
    $if (_device = _33CK128MP202)                                                           '
        Or (_device = _33CK128MP203) Or (_device = _33CK128MP205) Or (_device = _33CK128MP206)  '
        Or (_device = _33CK128MP208) Or (_device = _33CK128MP502) Or (_device = _33CK128MP503)  '
        Or (_device = _33CK128MP505) Or (_device = _33CK128MP506) Or (_device = _33CK128MP508)  '
        Or (_device = _33CK256MP202) Or (_device = _33CK256MP203) Or (_device = _33CK256MP205)  '
        Or (_device = _33CK256MP206) Or (_device = _33CK256MP208) Or (_device = _33CK256MP502)  '
        Or (_device = _33CK256MP503) Or (_device = _33CK256MP505) Or (_device = _33CK256MP506)  '
        Or (_device = _33CK256MP508) Or (_device = _33CK32MP102) Or (_device = _33CK32MP103)    '
        Or (_device = _33CK32MP105) Or (_device = _33CK32MP202) Or (_device = _33CK32MP203)     '
        Or (_device = _33CK32MP205) Or (_device = _33CK32MP206) Or (_device = _33CK32MP502)     '
        Or (_device = _33CK32MP503) Or (_device = _33CK32MP505) Or (_device = _33CK32MP506)     '
        Or (_device = _33CK64MP102) Or (_device = _33CK64MP103) Or (_device = _33CK64MP105)     '
        Or (_device = _33CK64MP202) Or (_device = _33CK64MP203) Or (_device = _33CK64MP205)     '
        Or (_device = _33CK64MP206) Or (_device = _33CK64MP208) Or (_device = _33CK64MP502)     '
        Or (_device = _33CK64MP503) Or (_device = _33CK64MP505) Or (_device = _33CK64MP506)     '
        Or (_device = _33CK64MP508) Or (_device = _33EP16GS202) Or (_device = _33EP32GS202)
        $define cADC_HAS_CORE0
        $define cADC_HAS_CORE1
    $endif

    '-------------------------------------------------------------------------------------------------------------
    ' Comparator availability
    '
    $if (_device = _33CK32MC102) Or (_device = _33CK32MC103)                                    '
        Or (_device = _33CK32MC105) Or (_device = _33CK32MP102) Or (_device = _33CK32MP103)     '
        Or (_device = _33CK32MP105) Or (_device = _33CK32MP202) Or (_device = _33CK32MP203)     '
        Or (_device = _33CK32MP205) Or (_device = _33CK32MP206) Or (_device = _33CK32MP502)     '
        Or (_device = _33CK32MP503) Or (_device = _33CK32MP505) Or (_device = _33CK32MP506)     '
        Or (_device = _33CK64MC102) Or (_device = _33CK64MC103) Or (_device = _33CK64MC105)     '
        Or (_device = _33CK64MP102) Or (_device = _33CK64MP103) Or (_device = _33CK64MP105)     '
        Or (_device = _33CK64MP202) Or (_device = _33CK64MP203) Or (_device = _33CK64MP205)     '
        Or (_device = _33CK64MP206) Or (_device = _33CK64MP208) Or (_device = _33CK64MP502)     '
        Or (_device = _33CK64MP503) Or (_device = _33CK64MP505) Or (_device = _33CK64MP506)     '
        Or (_device = _33CK64MP508) Or (_device = _33CK128MP202) Or (_device = _33CK128MP203)   '
        Or (_device = _33CK128MP205) Or (_device = _33CK128MP206) Or (_device = _33CK128MP208)  '
        Or (_device = _33CK128MP502) Or (_device = _33CK128MP503) Or (_device = _33CK128MP505)  '
        Or (_device = _33CK128MP506) Or (_device = _33CK128MP508) Or (_device = _33CK256MP202)  '
        Or (_device = _33CK256MP203) Or (_device = _33CK256MP205) Or (_device = _33CK256MP206)  '
        Or (_device = _33CK256MP208) Or (_device = _33CK256MP305) Or (_device = _33CK256MP306)  '
        Or (_device = _33CK256MP308) Or (_device = _33CK256MP502) Or (_device = _33CK256MP503)  '
        Or (_device = _33CK256MP505) Or (_device = _33CK256MP506) Or (_device = _33CK256MP508)  '
        Or (_device = _33CK256MP605) Or (_device = _33CK256MP606) Or (_device = _33CK256MP608)  '
        Or (_device = _33CK512MP305) Or (_device = _33CK512MP306) Or (_device = _33CK512MP308)  '
        Or (_device = _33CK512MP605) Or (_device = _33CK512MP606) Or (_device = _33CK512MP608)
        $define cADC_COMPARATOR_COUNT 4

    $else
        $define cADC_COMPARATOR_COUNT 0
    $endif

    '-------------------------------------------------------------------------------------------------------------
    ' Digital filter availability
    '
    $if (_device = _33CK32MC102) Or (_device = _33CK32MC103)                                    '
        Or (_device = _33CK32MC105) Or (_device = _33CK32MP102) Or (_device = _33CK32MP103)     '
        Or (_device = _33CK32MP105) Or (_device = _33CK32MP202) Or (_device = _33CK32MP203)     '
        Or (_device = _33CK32MP205) Or (_device = _33CK32MP206) Or (_device = _33CK32MP502)     '
        Or (_device = _33CK32MP503) Or (_device = _33CK32MP505) Or (_device = _33CK32MP506)     '
        Or (_device = _33CK64MC102) Or (_device = _33CK64MC103) Or (_device = _33CK64MC105)     '
        Or (_device = _33CK64MP102) Or (_device = _33CK64MP103) Or (_device = _33CK64MP105)     '
        Or (_device = _33CK64MP202) Or (_device = _33CK64MP203) Or (_device = _33CK64MP205)     '
        Or (_device = _33CK64MP206) Or (_device = _33CK64MP208) Or (_device = _33CK64MP502)     '
        Or (_device = _33CK64MP503) Or (_device = _33CK64MP505) Or (_device = _33CK64MP506)     '
        Or (_device = _33CK64MP508) Or (_device = _33CK128MP202) Or (_device = _33CK128MP203)   '
        Or (_device = _33CK128MP205) Or (_device = _33CK128MP206) Or (_device = _33CK128MP208)  '
        Or (_device = _33CK128MP502) Or (_device = _33CK128MP503) Or (_device = _33CK128MP505)  '
        Or (_device = _33CK128MP506) Or (_device = _33CK128MP508) Or (_device = _33CK256MP202)  '
        Or (_device = _33CK256MP203) Or (_device = _33CK256MP205) Or (_device = _33CK256MP206)  '
        Or (_device = _33CK256MP208) Or (_device = _33CK256MP305) Or (_device = _33CK256MP306)  '
        Or (_device = _33CK256MP308) Or (_device = _33CK256MP502) Or (_device = _33CK256MP503)  '
        Or (_device = _33CK256MP505) Or (_device = _33CK256MP506) Or (_device = _33CK256MP508)  '
        Or (_device = _33CK256MP605) Or (_device = _33CK256MP606) Or (_device = _33CK256MP608)  '
        Or (_device = _33CK512MP305) Or (_device = _33CK512MP306) Or (_device = _33CK512MP308)  '
        Or (_device = _33CK512MP605) Or (_device = _33CK512MP606) Or (_device = _33CK512MP608)
        $define cADC_DIGITAL_FILTER_COUNT 4

    $else
        $define cADC_DIGITAL_FILTER_COUNT 0
    $endif

    '-------------------------------------------------------------------------------------------------------------
    ' Trigger sources
    '
    $define cADC_TRIGSRC00 ADTRIG0Lbits.TRGSRC0
    $define cADC_TRIGSRC01 ADTRIG0Lbits.TRGSRC1
    $define cADC_TRIGSRC02 ADTRIG0Hbits.TRGSRC2
    $define cADC_TRIGSRC03 ADTRIG0Hbits.TRGSRC3
    $define cADC_TRIGSRC04 ADTRIG1Lbits.TRGSRC4
    $define cADC_TRIGSRC05 ADTRIG1Lbits.TRGSRC5
    $define cADC_TRIGSRC06 ADTRIG1Hbits.TRGSRC6
    $define cADC_TRIGSRC07 ADTRIG1Hbits.TRGSRC7
    $define cADC_TRIGSRC08 ADTRIG2Lbits.TRGSRC8
    $define cADC_TRIGSRC09 ADTRIG2Lbits.TRGSRC9
    $define cADC_TRIGSRC10 ADTRIG2Hbits.TRGSRC10
    $define cADC_TRIGSRC11 ADTRIG2Hbits.TRGSRC11
    $define cADC_TRIGSRC12 ADTRIG3Lbits.TRGSRC12
    $define cADC_TRIGSRC13 ADTRIG3Lbits.TRGSRC13
    $define cADC_TRIGSRC14 ADTRIG3Hbits.TRGSRC14
    $define cADC_TRIGSRC15 ADTRIG3Hbits.TRGSRC15
    $define cADC_TRIGSRC16 ADTRIG4Lbits.TRGSRC16
    $define cADC_TRIGSRC17 ADTRIG4Lbits.TRGSRC17
    $define cADC_TRIGSRC18 ADTRIG4Hbits.TRGSRC18
    $define cADC_TRIGSRC19 ADTRIG4Hbits.TRGSRC19
    $define cADC_TRIGSRC20 ADTRIG5Lbits.TRGSRC20
    $define cADC_TRIGSRC21 ADTRIG5Lbits.TRGSRC21
    $define cADC_TRIGSRC22 ADTRIG5Hbits.TRGSRC22
    $define cADC_TRIGSRC23 ADTRIG5Hbits.TRGSRC23
    $define cADC_TRIGSRC24 ADTRIG6Lbits.TRGSRC24
    $define cADC_TRIGSRC25 ADTRIG6Lbits.TRGSRC25
    $define cADC_TRIGSRC26 ADTRIG6Hbits.TRGSRC26
    $define cADC_TRIGSRC27 ADTRIG6Hbits.TRGSRC27
    $define cADC_TRIGSRC28 ADTRIG7Lbits.TRGSRC28
    $define cADC_TRIGSRC29 ADTRIG7Lbits.TRGSRC29
    $define cADC_TRIGSRC30 ADTRIG7Hbits.TRGSRC30
    $define cADC_TRIGSRC31 ADTRIG7Hbits.TRGSRC31

    $if (_device = _33CK32MC102) Or (_device = _33CK32MC103) Or (_device = _33CK32MC105)         '
        Or (_device = _33CK64MC102) Or (_device = _33CK64MC103) Or (_device = _33CK64MC105)     '
        Or (_device = _33CK32MP102) Or (_device = _33CK32MP103) Or (_device = _33CK32MP105)     '
        Or (_device = _33CK64MP102) Or (_device = _33CK64MP103) Or (_device = _33CK64MP105)
        '
        ' CK MP1XX
        '
        $define cADC_TRGSRC_ADTRG31       %00011111
        $define cADC_TRGSRC_MSTR_PTG      %00011110
        $define cADC_TRGSRC_CLC4          %00010010
        $define cADC_TRGSRC_CLC3          %00010001
        $define cADC_TRGSRC_CLC2          %00011101
        $define cADC_TRGSRC_CLC1          %00011100
        $define cADC_TRGSRC_MCCP5         %00011000
        $define cADC_TRGSRC_SCCP4         %00010111
        $define cADC_TRGSRC_SCCP3         %00010110
        $define cADC_TRGSRC_SCCP2         %00010101
        $define cADC_TRGSRC_SCCP1         %00010100
        $define cADC_TRGSRC_MCCP5_TRG     %00010000
        $define cADC_TRGSRC_SCCP4_TRG     %00001111
        $define cADC_TRGSRC_SCCP3_TRG     %00001110
        $define cADC_TRGSRC_SCCP2_TRG     %00001101
        $define cADC_TRGSRC_SCCP1_TRG     %00001100
        $define cADC_TRGSRC_PWM4_TRG2     %00001011
        $define cADC_TRGSRC_PWM4_TRG1     %00001010
        $define cADC_TRGSRC_PWM3_TRG2     %00001001
        $define cADC_TRGSRC_PWM3_TRG1     %00001000
        $define cADC_TRGSRC_PWM2_TRG2     %00000111
        $define cADC_TRGSRC_PWM2_TRG1     %00000110
        $define cADC_TRGSRC_PWM1_TRG2     %00000101
        $define cADC_TRGSRC_PWM1_TRG1     %00000100
        $define cADC_TRGSRC_SOFTTRG       %00000010
        $define cADC_TRGSRC_COMMONSOFTTRG %00000001
        $define cADC_TRGSRC_NOTRIG        %00000000

    $elseif (_device = _33CK32MP202) Or (_device = _33CK32MP203) Or (_device = _33CK32MP205)     '
        Or (_device = _33CK32MP206) Or (_device = _33CK32MP502) Or (_device = _33CK32MP503)     '
        Or (_device = _33CK32MP505) Or (_device = _33CK32MP506) Or (_device = _33CK64MP202)     '
        Or (_device = _33CK64MP203) Or (_device = _33CK64MP205) Or (_device = _33CK64MP206)     '
        Or (_device = _33CK64MP208) Or (_device = _33CK64MP502) Or (_device = _33CK64MP503)     '
        Or (_device = _33CK64MP505) Or (_device = _33CK64MP506) Or (_device = _33CK64MP508)     '
        Or (_device = _33CK128MP202) Or (_device = _33CK128MP203) Or (_device = _33CK128MP205)  '
        Or (_device = _33CK128MP206) Or (_device = _33CK128MP208) Or (_device = _33CK128MP502)  '
        Or (_device = _33CK128MP503) Or (_device = _33CK128MP505) Or (_device = _33CK128MP506)  '
        Or (_device = _33CK128MP508) Or (_device = _33CK256MP202) Or (_device = _33CK256MP203)  '
        Or (_device = _33CK256MP205) Or (_device = _33CK256MP206) Or (_device = _33CK256MP208)  '
        Or (_device = _33CK256MP305) Or (_device = _33CK256MP306) Or (_device = _33CK256MP308)  '
        Or (_device = _33CK256MP502) Or (_device = _33CK256MP503) Or (_device = _33CK256MP505)  '
        Or (_device = _33CK256MP506) Or (_device = _33CK256MP508) Or (_device = _33CK256MP605)  '
        Or (_device = _33CK256MP606) Or (_device = _33CK256MP608) Or (_device = _33CK512MP305)  '
        Or (_device = _33CK512MP306) Or (_device = _33CK512MP308) Or (_device = _33CK512MP605)  '
        Or (_device = _33CK512MP606) Or (_device = _33CK512MP608)
        '
        ' CK MP2/3/5/6XX
        '
        $define cADC_TRGSRC_ADTRG31       %00011111
        $define cADC_TRGSRC_MSTR_PTG      %00011110
        $define cADC_TRGSRC_CLC2          %00011101
        $define cADC_TRGSRC_CLC1          %00011100
        $define cADC_TRGSRC_MCCP9         %00011011
        $define cADC_TRGSRC_SCCP7         %00011010
        $define cADC_TRGSRC_SCCP6         %00011001
        $define cADC_TRGSRC_SCCP5         %00011000
        $define cADC_TRGSRC_SCCP4         %00010111
        $define cADC_TRGSRC_SCCP3         %00010110
        $define cADC_TRGSRC_SCCP2         %00010101
        $define cADC_TRGSRC_SCCP1         %00010100
        $define cADC_TRGSRC_PWM8_TRG2     %00010011
        $define cADC_TRGSRC_PWM8_TRG1     %00010010
        $define cADC_TRGSRC_PWM7_TRG2     %00010001
        $define cADC_TRGSRC_PWM7_TRG1     %00010000
        $define cADC_TRGSRC_PWM6_TRG2     %00001111
        $define cADC_TRGSRC_PWM6_TRG1     %00001110
        $define cADC_TRGSRC_PWM5_TRG2     %00001101
        $define cADC_TRGSRC_PWM5_TRG1     %00001100
        $define cADC_TRGSRC_PWM4_TRG2     %00001011
        $define cADC_TRGSRC_PWM4_TRG1     %00001010
        $define cADC_TRGSRC_PWM3_TRG2     %00001001
        $define cADC_TRGSRC_PWM3_TRG1     %00001000
        $define cADC_TRGSRC_PWM2_TRG2     %00000111
        $define cADC_TRGSRC_PWM2_TRG1     %00000110
        $define cADC_TRGSRC_PWM1_TRG2     %00000101
        $define cADC_TRGSRC_PWM1_TRG1     %00000100
        $define cADC_TRGSRC_SOFTTRG       %00000010
        $define cADC_TRGSRC_COMMONSOFTTRG %00000001
        $define cADC_TRGSRC_NOTRIG        %00000000
    $endif

    '---------------------------------------------------------------------------------------------
    ' Load the SHRRES bits of the ADCON1H SFR
    ' Input     : pRes holds the resolution value
    '               3 = 12-bit resolution
    '               2 = 10-bit resolution
    '               1 = 8-bit resolution
    '               0 = 6-bit resolution
    ' Output    : None
    ' Notes     : None
    '
    $define ADCON1H_SHRRES(pRes) '
    $if pRes = 0             '
        ADCON1H.5 = 0        '
        ADCON1H.6 = 0        '
    $elseif pRes = 1         '
        ADCON1H.5 = 1        '
        ADCON1H.6 = 0        '
    $elseif pRes = 2         '
        ADCON1H.5 = 0        '
        ADCON1H.6 = 1        '
    $elseif pRes = 3         '
        ADCON1H.5 = 1        '
        ADCON1H.6 = 1        '
    $endif

    '---------------------------------------------------------------------------------------------
    ' Load the CNVCHSEL bits of the ADCON3L SFR
    ' Input     : pChan holds the channel value
    ' Output    : None
    ' Notes     : None
    '
    $define ADCON3L_CNVCHSEL(pChan)           '
    ADCON3L = ADCON3L & %1111111111000000 '
    ADCON3L = ADCON3L | pChan

    '---------------------------------------------------------------------------------------------
    ' Load the REFSEL bits of the ADCON3L SFR
    ' Input     : pValue holds the value to place in the bits
    ' Output    : None
    ' Notes     : None
    '
    $define ADCON3L_REFSEL(pValue)                '
    ADCON3L.Byte1 = ADCON3L.Byte1 & %00011111 '
    ADCON3L.Byte1 = ADCON3L.Byte1 | (pValue << 7)

    '---------------------------------------------------------------------------------------------
    ' Load the CLKDIV bits of the ADCON3H SFR
    ' Input     : pValue holds the clk value
    ' Output    : None
    ' Notes     : None
    '
    $define ADCON3H_CLKDIV(pValue)             '
    ADCON3H.Byte1 =  %00000000             '
    ADCON3H.Byte1 = ADCON3H.Byte1 | pValue

    '---------------------------------------------------------------------------------------------
    ' Load the CLKSEL bits of the ADCON3H SFR
    ' Input     : pValue holds the value to place in the bits
    ' Output    : None
    ' Notes     : None
    '
    $define ADCON3H_CLKSEL(pValue)                '
    ADCON3H.Byte1 = ADCON3H.Byte1 & %00111111 '
    ADCON3H.Byte1 = ADCON3H.Byte1 | (pValue << 7)

    '---------------------------------------------------------------------------------------------
    ' Load the WARMTIME bits of the ADCON5H SFR
    ' Input     : pValue holds the warm up time value
    ' Output    : None
    ' Notes     : None
    '
    $define ADCON5H_WARMTIME(pValue)              '
    ADCON5H.Byte1 = ADCON5H.Byte1 & %11110000 '
    ADCON5H.Byte1 = ADCON5H.Byte1 | pValue

    '---------------------------------------------------------------------------------------------
    ' Load the SHRSAMC bits of the ADCON2H SFR
    ' Input     : pValue holds the value to place in the bits
    ' Output    : None
    ' Notes     : None
    '
    $define ADCON2H_SHRSAMC(pValue)           '
    ADCON2H = ADCON2H & %1111110000000000 '
    ADCON2H = ADCON2H | (pValue << 9)

    '---------------------------------------------------------------------------------------------
    ' Load the RES bits of the ADCORE0H SFR
    ' Input     : pRes holds the resolution value
    '               3 = 12-bit resolution
    '               2 = 10-bit resolution
    '               1 = 8-bit resolution
    '               0 = 6-bit resolution
    ' Output    : None
    ' Notes     : None
    '
    $define ADCORE0H_RES(pRes) '
    $if pRes = 0           '
        ADCORE0H.8 = 0     '
        ADCORE0H.9 = 0     '
    $elseif pRes = 1       '
        ADCORE0H.8 = 1     '
        ADCORE0H.9 = 0     '
    $elseif pRes = 2       '
        ADCORE0H.8 = 0     '
        ADCORE0H.9 = 1     '
    $elseif pRes = 3       '
        ADCORE0H.8 = 1     '
        ADCORE0H.9 = 1     '
    $endif

    '---------------------------------------------------------------------------------------------
    ' Load the RES bits of the ADCORE1H SFR
    ' Input     : pRes holds the resolution value
    '               3 = 12-bit resolution
    '               2 = 10-bit resolution
    '               1 = 8-bit resolution
    '               0 = 6-bit resolution
    ' Output    : None
    ' Notes     : None
    '
    $define ADCORE1H_RES(pRes) '
    $if pRes = 0           '
        ADCORE1H.8 = 0     '
        ADCORE1H.9 = 0     '
    $elseif pRes = 1       '
        ADCORE1H.8 = 1     '
        ADCORE1H.9 = 0     '
    $elseif pRes = 2       '
        ADCORE1H.8 = 0     '
        ADCORE1H.9 = 1     '
    $elseif pRes = 3       '
        ADCORE1H.8 = 1     '
        ADCORE1H.9 = 1     '
    $endif

    '---------------------------------------------------------------------------------------------
    ' Load the RES bits of the ADCORE2H SFR
    ' Input     : pRes holds the resolution value
    '               3 = 12-bit resolution
    '               2 = 10-bit resolution
    '               1 = 8-bit resolution
    '               0 = 6-bit resolution
    ' Output    : None
    ' Notes     : None
    '
    $define ADCORE2H_RES(pRes) '
    $if pRes = 0           '
        ADCORE2H.8 = 0     '
        ADCORE2H.9 = 0     '
    $elseif pRes = 1       '
        ADCORE2H.8 = 1     '
        ADCORE2H.9 = 0     '
    $elseif pRes = 2       '
        ADCORE2H.8 = 0     '
        ADCORE2H.9 = 1     '
    $elseif pRes = 3       '
        ADCORE2H.8 = 1     '
        ADCORE2H.9 = 1     '
    $endif

    '---------------------------------------------------------------------------------------------
    ' Load the RES bits of the ADCORE3H SFR
    ' Input     : pRes holds the resolution value
    '               3 = 12-bit resolution
    '               2 = 10-bit resolution
    '               1 = 8-bit resolution
    '               0 = 6-bit resolution
    ' Output    : None
    ' Notes     : None
    '
    $define ADCORE3H_RES(pRes) '
    $if pRes = 0           '
        ADCORE3H.8 = 0     '
        ADCORE3H.9 = 0     '
    $elseif pRes = 1       '
        ADCORE3H.8 = 1     '
        ADCORE3H.9 = 0     '
    $elseif pRes = 2       '
        ADCORE3H.8 = 0     '
        ADCORE3H.9 = 1     '
    $elseif pRes = 3       '
        ADCORE3H.8 = 1     '
        ADCORE3H.9 = 1     '
    $endif

    '---------------------------------------------------------------------------------------------
    ' Load the SAMC bits of the ADCORE0L SFR
    ' Input     : pValue holds the value to place into the bits
    ' Output    : None
    ' Notes     : None
    '
    $define ADCORE0L_SAMC(pValue)               '
    ADCORE0L = ADCORE0L & %1111110000000000 '
    ADCORE0L = ADCORE0L | pValue

    '---------------------------------------------------------------------------------------------
    ' Load the SAMC bits of the ADCORE1L SFR
    ' Input     : pValue holds the value to place into the bits
    ' Output    : None
    ' Notes     : None
    '
    $define ADCORE1L_SAMC(pValue)               '
    ADCORE1L = ADCORE1L & %1111110000000000 '
    ADCORE1L = ADCORE1L | pValue

    '---------------------------------------------------------------------------------------------
    ' Load the SAMC bits of the ADCORE2L SFR
    ' Input     : pValue holds the value to place into the bits
    ' Output    : None
    ' Notes     : None
    '
    $define ADCORE2L_SAMC(pValue)               '
    ADCORE2L = ADCORE2L & %1111110000000000 '
    ADCORE2L = ADCORE2L | pValue

    '---------------------------------------------------------------------------------------------
    ' Load the SAMC bits of the ADCORE3L SFR
    ' Input     : pValue holds the value to place into the bits
    ' Output    : None
    ' Notes     : None
    '
    $define ADCORE3L_SAMC(pValue)               '
    ADCORE3L = ADCORE3L & %1111110000000000 '
    ADCORE3L = ADCORE3L | pValue

    '---------------------------------------------------------------------------------------------
    ' Load the ADCS bits of the ADCORE0H SFR
    ' Input     : pValue holds the value to place into the bits
    ' Output    : None
    ' Notes     : None
    '
    $define ADCORE0H_ADCS(pValue)                   '
    ADCORE0H.Byte0 = ADCORE0H.Byte0 & %10000000 '
    ADCORE0H.Byte0 = ADCORE0H.Byte0 | pValue

    '---------------------------------------------------------------------------------------------
    ' Load the ADCS bits of the ADCORE1H SFR
    ' Input     : pValue holds the value to place into the bits
    ' Output    : None
    ' Notes     : None
    '
    $define ADCORE1H_ADCS(pValue)                   '
    ADCORE1H.Byte0 = ADCORE1H.Byte0 & %10000000 '
    ADCORE1H.Byte0 = ADCORE1H.Byte0 | pValue

    '---------------------------------------------------------------------------------------------
    ' Load the ADCS bits of the ADCORE2H SFR
    ' Input     : pValue holds the value to place into the bits
    ' Output    : None
    ' Notes     : None
    '
    $define ADCORE2H_ADCS(pValue)                   '
    ADCORE2H.Byte0 = ADCORE2H.Byte0 & %10000000 '
    ADCORE2H.Byte0 = ADCORE2H.Byte0 | pValue

    '---------------------------------------------------------------------------------------------
    ' Load the ADCS bits of the ADCORE3H SFR
    ' Input     : pValue holds the value to place into the bits
    ' Output    : None
    ' Notes     : None
    '
    $define ADCORE3H_ADCS(pValue)                   '
    ADCORE3H.Byte0 = ADCORE3H.Byte0 & %10000000 '
    ADCORE3H.Byte0 = ADCORE3H.Byte0 | pValue

    '---------------------------------------------------------------------------------------------
    ' Load the SHRADCS bits of the ADCON2L SFR
    ' Input     : pValue holds the value to place into the bits
    ' Output    : None
    ' Notes     : None
    '
    $define ADCON2L_SHRADCS(pValue)               '
    ADCON2L.Byte0 = ADCON2L.Byte0 & %10000000 '
    ADCON2L.Byte0 = ADCON2L.Byte0 | pValue

    '---------------------------------------------------------------------------------------------
    ' Create some variables for the library routines
    '
    Dim ADC_bMasterClock_Src As Byte = 0        ' Default is clock from FP (FOSC /2)
    Dim ADC_bMasterClock_Div As Byte = 0        ' Default is 1:1 clock divider
    Dim ADC_wChannelBitMask  As Word            ' Holds a bitmask for an ADC channel

    '------------------------------------------------------------------------------------
    ' Initialise the ADCs with default values
    ' Input     : None
    ' Output    : None
    ' Notes     : Initialises all the ADCs that the device has
    '
    Proc ADC_Init()

        $ifdef _ADC1MD
            ADC1MD = 0
            DelayCS 1
        $endif
        '
        ' Configure the common ADC clock
        '
        ADCON3H_CLKSEL(ADC_bMasterClock_Src)
        ADCON3H_CLKDIV(ADC_bMasterClock_Div)
        '
        ' Configure the cores ADC clock
        '
        $ifdef cADC_HAS_CORE0
            ADCORE0H_ADCS(1)                            ' Clock divider (1:2)
            ADCORE0H_RES(3)                             ' 12-bits
            ADCORE0L_SAMC(5)                           ' 18 Tad delay before sampling
            ADCON4Lbits_SAMC0EN = 1                     ' Conversion delay enabled
        $endif

        $ifdef cADC_HAS_CORE1
            ADCORE1H_ADCS(1)                            ' Clock divider (1:2)
            ADCORE1H_RES(3)                             ' 12-bits
            ADCORE1L_SAMC(5)                           ' 18 Tad delay before sampling
            ADCON4Lbits_SAMC1EN = 1                     ' Conversion delay enabled
        $endif

        $ifdef cADC_HAS_CORE2
            ADCORE2H_ADCS(1)                            ' Clock divider (1:2)
            ADCORE2H_RES(3)                             ' 12-bits
            ADCORE2L_SAMC(5)                           ' 18 Tad delay before sampling
            ADCON4Lbits_SAMC2EN = 1                     ' Conversion delay enabled
        $endif

        $ifdef cADC_HAS_CORE3
            ADCORE3H_ADCS(1)                            ' Clock divider (1:2)
            ADCORE3H_RES(3)                             ' 12-bits
            ADCORE3L_SAMC(5)                           ' 18 Tad delay before sampling
            ADCON4Lbits_SAMC3EN = 1                     ' Conversion delay enabled
        $endif

        ADCON3L_REFSEL(0)                           ' AVdd as voltage reference
        ADCON1Hbits_FORM = 0                        ' Integer format
        ADCON2L_SHRADCS(1)                          ' Clock divider (1:2)
        ADCON1H_SHRRES(3)                           ' 12-bits
        ADCON2H_SHRSAMC(5)                         ' 18 Tad

        ADC_Setup()                                 ' Setup the ADC cores
    EndProc

    '------------------------------------------------------------------------------------
    ' Setup the ADCs
    ' Input     : None
    ' Output    : None
    ' Notes     : Sets up all the ADCs that the device has
    '
    Proc ADC_Setup()
        ADCON5H_WARMTIME(15)                        ' Set initialisation time to maximum
        ADCON1Lbits_ADON = 1                        ' Turn on the ADC module

        $ifdef cADC_HAS_CORE0
            ADCON5Lbits_C0PWR = 1                       ' Turn on analogue power for ADC core 0
            While ADCON5Lbits_C0RDY = 0: Wend           ' Wait until core 0 is ready for operation
            ADCON3Hbits_C0EN = 1                        ' Turn on digital power to enable triggers to core 0
        $endif

        $ifdef cADC_HAS_CORE1
            ADCON5Lbits_C1PWR = 1                       ' Turn on analogue power for ADC core 1
            While ADCON5Lbits_C1RDY = 0: Wend           ' Wait until core 1 is ready for operation
            ADCON3Hbits_C1EN = 1                        ' Turn on digital power to enable triggers to core 1
        $endif

        $ifdef cADC_HAS_CORE2
            ADCON5Lbits_C2PWR = 1                       ' Turn on analogue power for ADC core 2
            While ADCON5Lbits_C2RDY = 0: Wend           ' Wait until core 1 is ready for operation
            ADCON3Hbits_C2EN = 1                        ' Turn on digital power to enable triggers to core 2
        $endif

        $ifdef cADC_HAS_CORE3
            ADCON5Lbits_C3PWR = 1                       ' Turn on analogue power for ADC core 3
            While ADCON5Lbits_C3RDY = 0: Wend           ' Wait until core 1 is ready for operation
            ADCON3Hbits_C3EN = 1                        ' Turn on digital power to enable triggers to core 3
        $endif

        ADCON5Lbits_SHRPWR = 1                      ' Turn on analogue power for the shared ADC core
        While ADCON5Lbits_SHRRDY = 0: Wend          ' Wait until the shared core is ready for operation
        ADCON3Hbits_SHREN = 1                       ' Turn on digital power to enable triggers to the shared core
    EndProc

    '------------------------------------------------------------------------------------
    ' Read an ADC sample channel
    ' Input     : pChannel holds the ADC channel to read
    ' Output    : Returns the ADC value, or $FFFF if an incorrect channel is chosen
    ' Notes     : None
    '
    Proc ADC_Read(pChannel As Byte), Word
        Dim wADCBUF_Address As Word = AddressOf(ADCBUF0) + ( pChannel * 2 )' Point to the correct ADC channel's buffer

        If pChannel >= cADC_CHANNEL_MAX Then
            Result = $FFFF
            ExitProc
        EndIf

        While ADCON3Lbits_CNVRTCH = 1: Wend

        ADCON3L_CNVCHSEL(pChannel)          ' Select the channel to read
        ADCON3Lbits_CNVRTCH = 1             ' Start sampling

        If pChannel < 16 Then
            ADC_wChannelBitMask = 1 << pChannel
            While (ADSTATL & ADC_wChannelBitMask) = 0: Wend
        Else
            pChannel = pChannel - 16
            ADC_wChannelBitMask = 1 << pChannel
            While (ADSTATH & ADC_wChannelBitMask) = 0: Wend
        EndIf
        '' delayms 10
        Result = Ptr16(wADCBUF_Address)      ' Read and return the ADC conversion result
    EndProc

    '------------------------------------------------------------------------------------
    ' Set an ADC channel to analogue
    ' Input     : pChannel holds the channel to make analogue
    ' Output    : None
    ' Notes     : The ADC channel starts from AN0, which is channel 0
    '
    '    Proc ADC_Channel(pChannel As Byte)
    '        If pChannel < 16 Then
    '            $ifdef _PORTA
    '                SetBit ANSELA, pChannel
    '            $endif
    '
    '        ElseIf pChannel < 32 Then
    '            $ifdef _PORTB
    '                SetBit ANSELB, pChannel
    '            $endif
    '
    '            $ifdef _PORTC
    '            ElseIf pChannel < 48 Then
    '                SetBit ANSELC, pChannel
    '            $endif
    '            $ifdef _PORTD
    '            ElseIf pChannel < 64 Then
    '                SetBit ANSELD, pChannel
    '            $endif
    '        EndIf
    '    EndProc

$endif  ' ADC_DSPIC33CK_INC


JohnB

I have started to get closer to the problem, it seems that I'm not freeing up memory when I switch between pages but I assume I am freeing it when the application shuts down as I don't get any memory leaks reported on shutdown.

Just got to narrow it down. It only happens when displaying basic files, ini files are fine as are plain text files.
JohnB

John Lawton

Hi John,

I've been running the build 14 you gave me a link for recently and it is running fine so far, seems a bit snappier than the previous build which is great.

John

JohnB

I have more work still to do on it so it won't be published for a while.
JohnB

JohnB

Positron Studio version 2.0.2.14 has been released.

New features included are:
New – Added a Pin button in the title bar of the tool windows. 
New – If you open a document from Ctr+O you will also be able to view '.lst' Files in the editor.
New – Added Menu item under Toolbars to completely hide toolbar.
New – Code explorer expanded state is retained with each open document.
New – Added File Drag/Drop.  You can now add multiple files in a drag/drop.

Plus some improvements and fixes.  See What's New for full details.

Download Positron Studio
JohnB

Gamboa

Thank you John.

I have seen an icon that I have not seen before. A little green cockroach. At first I didn't know what it was for. One always thinks of Bug / Debug.

Debug.png
Then I clicked on the debug icon and I saw the Run, Animate, ETC icons. I was amazed to see this. A great joy has invaded me.

 DebugTools.png

Can you tell us something about this wonderful tool?

Regards,
Gamboa


Long live for you

Dompie

ehhh software debugger build in? That would be wonderfull.

Johan

JohnB

Work in Progress I am afraid, it wasn't supposed to be visible but I had forgotten to set the correct compiler directives.
Don't hold your breath, its going to be a very big development.
JohnB

Giuseppe MPO

I have installed the new version and it gives me this problem in the visualization of the loops.
Could it be some setting I touched?

Cattura.JPG

tumbleweed

#78
It only seems to match up if you have a code-folding region defined.

edit: I take that back. It was working that way for a bit, but once I played around w/code-folding it quit working and went back to Giuseppe's display.


JohnB

#79
I am aware of this - I recommend you turn code folding off or ensure there is at least one code folding region within the editing area.  This will get resolved but it requires a 3rd party control to be modified.
JohnB