Hi, Please, any one can help me to explain the following function: Q1) Function X_Init Q2) Function X Q3) Function sEOS_ISR() Q4) Function sEOS_Go_To_Sleep Code: #include <reg52.h> #define OSC_FREQ (12000000UL) #define OSC_PER_INST (12) void sEOS_Init_Timer2(const unsigned char); void sEOS_Go_To_Sleep(void); void X_Init(void); void X(void); void X_Init(void); #define INTERRUPT_TIMER_2_Overflow 5 void main(void) { X_Init(); // prepare for dummy task sEOS_Init_Timer2(60); // set up simple EOS (60ms tick interval) while(1) { sEOS_Go_To_Sleep(); } } void X_Init(void) { // Dummy task init function // Dummy task init... } void X(void) { // Dummy task called from sEOS ISR // Dummy task.... } void sEOS_ISR() interrupt INTERRUPT_TIMER_2_Overflow { TR2 = 0; X(); } void sEOS_Init_Timer2(const unsigned char TICK_MS) { unsigned long Inc; unsigned int Reload_16; unsigned char Reload_08H, Reload_08L; T2CON = 0x04; Inc = (TICK_MS * (OSC_FREQ/1000)) / OSC_PER_INST; // Inc = 60,000 = 0xEA60 Reload_16 = (65536UL - Inc); // Reload_16 = 5536 =0x15A0 Reload_08H = (Reload_16 / 256); Reload_08L = (Reload_16 % 256); TH2 = Reload_08H; // 0x15 RCAP2H = Reload_08H; TL2 = Reload_08L; // 0xA0 RCAP2L = Reload_08L; ET2 = 1; TR2 = 1; EA = 1; } void sEOS_Go_To_Sleep(void) { PCON |= 0x01; // enter idle mode (generic 8051 version) } Thank You
"Please, any one can help me to explain the following function: Q1) Function X_Init Q2) Function X Q3) Function sEOS_ISR() Q4) Function sEOS_Go_To_Sleep" You're joking, right?
This guy's probably going to write the code for the anti-lock brakes in your next car.
"This guy's probably going to write the code for the anti-lock brakes in your next car." By the time I can afford another car it'll probably have a Windows box attached to each wheel sensor. At least there'll be time for a cup of coffee in the morning while the bloody thing boots up. 'Where do YOU want to go today?' 'Nowhere, fortunately.'
#include <stdWindowsCarJoke.h> Of course, if it bluescreens while you're driving, all you need to do is close all your open windows and start again. You have my permission to groan. Steve
This guy's probably going to write the code for the anti-lock brakes in your next car. And you think that is scary?? Some people I know of thet are "specializing in bugs" have been hired to write a robot controlled colon biopsy machine. Erik
Hi, Please, can you all answer my question?? It is the code have anything wrong?? Thanks...
"Please, can you all answer my question?? It is the code have anything wrong??" Oh sorry, here we go: Q1) Function X_Init This function does nothing at all. Q2) Function X This function does nothing at all. Q3) Function sEOS_ISR() This function sets TR2 to 0, then calls function X(). Q4) Function sEOS_Go_To_Sleep This function sets PCON bit zero to 1. The code in these functions looks fine syntactically.
Now we know why Longhorn won't be available until the end of next year (at least).
Hi, First we discuss the 1) and 2), what's the purpose they put it like that?? Thanks...
Hi, If you say the the function 1) and 2) is doing nothing, so why when i cancer it 2 the performance analyzer will already show diffrent result?? Thanks..
"First we discuss the 1) and 2), what's the purpose they put it like that??" Well, how would I know? Ask them.
If you say the the function 1) and 2) is doing nothing, so why when i cancer it 2 the performance analyzer will already show diffrent result?? The problem is that you have not given us enough information to help you. In fact, most of the information we need is completely hidden or is aparently EMPTY. What you ask is something like this: "Please help me with my car. It is broken. My car is yellow with wheels and windows and a key that does something." Jon
"If you say the the function 1) and 2) is doing nothing, so why when i cancer it 2 the performance analyzer will already show diffrent result??" What does "cancer it 2" mean?
Hi, If i cancer the function 1) and 2), that is the meaning. Thanks..
Sorry... ha... why i always type wrong.. is "cancel function 1) and 2)"