System Variables Not Updated In Modules

General discussion on mikroBasic PRO for 8051.
Post Reply
Author
Message
BarryP
Posts: 517
Joined: 02 Apr 2007 03:57
Location: New Zealand

System Variables Not Updated In Modules

#1 Post by BarryP » 10 Feb 2011 04:24

I Have a Module That adjusts the Actual Clock & timer values Based on the Set System Clock

Code: Select all

module Interrupt_C8051

   Include "Global"
   '#define TMR3_Div12
   #IFDEF TMR3_Div12 Then
          const TMR3_100uS_Reload as word = 0xFFFF - ((Clock_Khz *1000) / 12 / 10000)   ' TMR3CN.T3M = 0
   #ELSE
   
          const TMR3_100uS_Reload as word = 0xFFFF - ( Clock_Khz / 10)        ' TMR3CN.T3M = 1       22118400
   #ENDIF
..... etc
This will Only Reflect a Change after a compile in TMR3_100uS_Reload , If I Modify The Module Or Delete the MCL

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: System Variables Not Updated In Modules

#2 Post by filip » 10 Feb 2011 14:36

Hi,

If you use Clock_kHz built-in routine you must do this, in order to reflect the changes.

Regards,
Filip.

Post Reply

Return to “mikroBasic PRO for 8051 General”