Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Reentrancy is not allowed: function 'Lcd_Out' called from two threads __Lib_Lcd.c

Status
Not open for further replies.

Adel Benaich

Newbie level 2
Joined
Jun 25, 2013
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
19
Help :Reentrancy is not allowed: function 'Lcd_Out' called from two threads

Dear gents,
i am having a simple program on PIC16F887 using MikroC:
it displays a certain message on an LCD, then upon an interrupt on PORTB it displays another message.
the first message code is written in the main function routine while the second message code is written in the interrupt function routine.
i get the following error message, can you help me how to solve this problem.


184 364 Reentrancy is not allowed: function 'Lcd_Out' called from two threads __Lib_Lcd.c
184 364 Reentrancy is not allowed: function 'Lcd_Out' called from two threads __Lib_Lcd.c
50 364 Reentrancy is not allowed: function 'Lcd_Chr_CP' called from two threads __Lib_Lcd.c
18 364 Reentrancy is not allowed: function 'Lcd_Cmd' called from two threads __Lib_Lcd.c
0 102 Finished (with errors): 03 Feb 2012, 23:13:42 LEDs.mcppi

Thanks in advance
Adil
 
Last edited:

In mikroC you can't do this, as this is not allowed, and not advised to.

Even i had this error many times, to solve this place your code in main.

Follow this algorithm:

* Declare a Global Variable Flag and initialize it to 0.
* Whenever your interrupt executes set that flag to 1.
* In main check that flag
if(flag == 1)
{
Display your message
flag = 0
}
 
Hi xpress_embedo !

So this is mean , I won't benifit to the interrupt fonction in the programm ? ....one more question are there an other ways with other compilers which th ability to ignore this reetrancy fonction ?

Thnks for all advices
 

I didn't get what you had written above.

I never use mikroC due to some of the issues related with this compiler.
I had some similar thing in MPLABC18 compiler and done this successfully without any problem.

- - - Updated - - -

Have a look at this thread

https://www.mikroe.com/forum/viewtopic.php?f=88&t=27129

Hi,

You can use the same routine both in interrupt and the main program, only if this routine contains no local variables and parameters.

The feature that you are talking about, informing compiler that there is no reentrancy, is currently not supported by the mikroC PRO for PIC,
It is a very interesting suggestion, and our developers will consider it and eventually add it, but I can't promise you anything.

Thank you for your feedback, and please feel free to inform us about any other problem or suggestion you might have.

I apologize for the inconvenience.

Regards,
Filip.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top