Hi
Sorry if this is addressed in some previous thread- I searched with no luck.
I have an ISR that handles data IO (USART commands), and I would like to have the ISR call a procedure to process the received information (so that polling is not needed). I have no problem calling a procedure within the module containing the ISR, but if I try to call a proecedure in another module, I get an error "ProcessData not declared,' where ProcessData is the procedure name in question.
In my Main module, I have included both the ISR module and the module containing the procedure "ProcessData." I can call ProcessData from the main module.
I saw a note suggesting that procedure/functions had to have their prototypes defined prior to 'impelements' to make them global (accessible to modules other than the Main module), but then I saw a note from ME saying that this was not yet implemented.
Am I doing something wrong here? I would rather not have to merge my data processing module into my ISR module- this separation is largely the reason for modules in general...
Any help is appreciated-
Regards,
R
Using ISR to call a procedure in a different module?
-
- Posts: 130
- Joined: 28 Nov 2006 17:59
if you have a module containg a ISR ( or whatever procedure) then all code called should be available to that module . Simples solutionl would be to have the procedure inside the module , alternatively you can use another module thereby making available its contents to your module.
By only making them available to main module your module is not aware , however , and this can be a little surprising , once a module uses another module ALL will be visible in the main module.
You have a look at help on scope and visibility allthough this is not completely accurate. Interface section implementation for the moment seems only effective for constant and variable declarations, NOT procedures and functions
By only making them available to main module your module is not aware , however , and this can be a little surprising , once a module uses another module ALL will be visible in the main module.
You have a look at help on scope and visibility allthough this is not completely accurate. Interface section implementation for the moment seems only effective for constant and variable declarations, NOT procedures and functions
-
- Posts: 130
- Joined: 28 Nov 2006 17:59
Hi JPC
Thank you for your response. May I ask for clarification here? Are you suggesting that if the Main module (call it module A) has an include for the ISR module (call it B), and for the Parsing module (C), that B cannot see C? And, that a workaround is to have A include B, and B include C? I tried having reciprocal includes A included BC, C included B, and that caused an infinite loop in the compile process and crashed during the build.
Best,
Rob
Thank you for your response. May I ask for clarification here? Are you suggesting that if the Main module (call it module A) has an include for the ISR module (call it B), and for the Parsing module (C), that B cannot see C? And, that a workaround is to have A include B, and B include C? I tried having reciprocal includes A included BC, C included B, and that caused an infinite loop in the compile process and crashed during the build.
Best,
Rob
Re: Using ISR to call a procedure in a different module?
I am having this exact same issue, where the compiler bombs out saying not enough RAM for CALL stack. It seems to be related to circular calling, but using the include statement as JPC has stated, did not fix the issue.
I am using compiler 4.6 Mikrobasic on a 16F628A PIC.
I wish module B to invoke a procedure on Module C. Whenever I install the procedure into module B (to invoke in module C) I get the error.
Installing an include statement in B - include "C" the fault comes back, ad the compiler has the RAM issue.
Any assistance of how to get around this would be appreciated.
I am using compiler 4.6 Mikrobasic on a 16F628A PIC.
I wish module B to invoke a procedure on Module C. Whenever I install the procedure into module B (to invoke in module C) I get the error.
Installing an include statement in B - include "C" the fault comes back, ad the compiler has the RAM issue.
Any assistance of how to get around this would be appreciated.
- slavisa.zlatanovic
- mikroElektronika team
- Posts: 1321
- Joined: 07 Apr 2009 09:39
Re: Using ISR to call a procedure in a different module?
Hi!
Please, create a minimal project which depicts the issue you're talking about and send it to me (slavisa.zlatanovic@mikroe.com).
Be sure to send me your whole project and not just source units. I'll try to reproduce your problem and suggest further steps.
Thanks!
Please, create a minimal project which depicts the issue you're talking about and send it to me (slavisa.zlatanovic@mikroe.com).
Be sure to send me your whole project and not just source units. I'll try to reproduce your problem and suggest further steps.
Thanks!
Best regards
Slavisa
Slavisa