Pumpkin, Inc.

Pumpkin User Forums

16 bit pointers

For issues specific to Microchip's PICmicro® MCUs, including compilers (e.g. HI-TECH PICC & PICC-18, Microchip MPLAB®-C18) and IDEs (e.g. Microchip MPLAB®).

16 bit pointers

Postby marco » Fri Oct 15, 2010 2:02 am

Hi to all,

I have a question for very expert Salvo OS users.
I use Salvo PRO in a PIC18F microcontroller using C18, an application grew for years and in these days it goes over the memory boundary of 64K.
Some troubles appears with some OStypeMsgP that refer to rom objects.
Reading docs and .h files from Salvo I found that the problem is because void* is just 16 wide on my compiler;

After this I found that I need to add to my salvocfg.h file this line
Code: Select all
#define OSMESSAGE_TYPE rom far void

Does anyone some experience like this, is it safe ?

Thank you

Marco
marco
 
Posts: 9
Joined: Mon Mar 27, 2006 12:00 am
Location: Italia

Re: 16 bit pointers

Postby aek » Fri Oct 15, 2010 9:16 am

OSMESSAGE_TYPE controls the message pointer type definition.

When using different types of pointers, in a Salvo Pro source-code build, it's OK to alter this definition for the purpose of testing new pointer types.

One quick way to verify whether the (new) pointer type is working is to watch OSecbArea[] (for events) and OStcbArea[] (for tasks -- this is more useful when you're changing function pointers) in MPLAB's watch window. Expand the fields, and you'll see how large the pointer is (e.g. 16 or 24 or 32 bits), and you can see its values, etc.

One problem with this is that you are likely to have to modify salvoportXXX.h, the header file associated with the compiler you are using. If you setup your include paths to pick up a "personal copy" of this file ahead of what's in Pumpkin/Salvo/Inc, you can keep a project-specific version (with the changes to OSMESSAGE_TYPE) local, and thereby not affect other builds. If you upgrade Salvo, however, you'll need to ensure that this header file is updated / current as well.

Of course you need Salvo Pro to do any of this. You can't do this within a library build, though you can create custom libraries with different pointer types. Assuming you test & develop this using a source code build, be sure to Build All to ensure that the change in pointer type propagates through all affected modules.
-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm


Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 0 guests

cron