Datasheet
Man_Break
318
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6
Prototype
void Man_Break();
Returns Nothing.
Description
Man_Receive is blocking routine and it can block the program flow. Call this rou-
tine from interrupt to unblock the program execution. This mechanism is similar
to WDT.
Note: Interrupts should be disabled before using Manchester routines again
(see note at the top of this page).
Requires Nothing.
Example
char data1, error, counter = 0;
void Timer0Overflow_ISR() org 0x12 {
if (counter >= 20) {
Man_Break();
counter = 0; // reset counter
}
else
counter++; // increment counter
}
void main() {
TOIE0_bit = 1; // Timer0 overflow interrupt
enable
TCCR0_bit = 5; // Start timer with 1024
prescaler
SREG_I = 0; // Interrupt disable
...
Man_Receive_Init();
...
// try Man_Receive with blocking prevention mechanism
SREG_I = 1; // Interrupt enable
data1 = Man_Receive(&error);
SREG_I = 0; // Interrupt disable
...
}