We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, The compile error is: WARNING L15: MULTIPLE CALL TO SEGMENT SEGMENT: ?PR?_STRTONUM?PARSE CALLER1: ?PR?TC0?PERIPHERAL CALLER2: ?C_C51STARTUP The callers TC0 is an ISR using reg bank 2 and I don't know about the c51startup. The called function STRTONUM is using the directive of #pragma NOAREGS so can be called for any functions. The question is why I still got the multiple call error? Thanks for answering my question. By the way, C51 is V6.21, BL51 is V4.21 and LIB51 is V4.20. chao.
Presumably, this STRTONUM function is just doing some sort of formatting for the display? Why not just keep the formatted result in a buffer, so that both main and the interrupt can access the buffer when they need to display it? This also has the advantage of relieving the ISR of the task of doing the formatting - which is generally a Good Thing.
Writing to an LCD is a very slow (relatively) operation, and not the sort of thing you should be doing inside an interrupt service. Your ISR would be better off setting a flag to note that the LCD requires updating, and regularly check this flag in your non-interrupt code.