/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / API pointers into circle_api.h

Username:     
Password:     
             

Forum

# 1   2008-06-27 20:17:46 API pointers into circle_api.h

kalbun
New member
From: Firenze, Italy
Registered: 2008-06-25
Posts: 4
Website

API pointers into circle_api.h

For an application that uses MEMS, I need to use some methods that are defined as "private" in the OS.

So I modified the source code and recompiled the OS (maybe it's not the best way... but could be a valid experience) to make the methods pubblic.

I suppose the next step is adding these methods to circle_api.h, and so I modified the file as follows:

#define MEMS_CHIPSELECT_ID        (MEMS_ID + 4)       // Select or deselect MEMS chip
#define MEMS_SENDBYTE_ID        (MEMS_ID + 5)       // Sends a byte to SPI and reads the answer

and

#define MEMS_ChipSelect(a)                 ((tCircleFunc1)(Circle_API [MEMS_CHIPSELECT_ID])) ( (u32)(a) )
#define MEMS_SendByte(a)               (u8)(((tCircleFunc1)(Circle_API [MEMS_SENDBYTE_ID])) ( (u32)(a) ))

But when the application runs the exception hardware_fault is called. I suspect the problem is in the Defines at the beginning of the file (POINTER_ID and so on) but have no idea how these pointers are calculated.

Any hints? Or am I on a totally wrong path? sad

Offline

 

# 2   2008-06-28 07:21:51 API pointers into circle_api.h

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: API pointers into circle_api.h

Did you modify the table? (circle_API.c).
You need to replace the next two null vectors by your own functions.

On the principle, you can modify and add new functions to the CircleOS in order to improve it for your own application. Now, the other solution (without modifying the OS) would be to disable the MEMS handler, and to add yours... That's would be easier and you will keep the compatibility with any other application.

Offline

 

Board footer