We inherited a project that targets the Renesas RX231 microcontroller that I was looking at.
This uC has only one instruction that blocks the bus for atomicity (XCHG).
Since the processor is the only component that accesses RAM memory (without using DMA or DTC) to manipulate variables in user code that are shared by interrupts, interrupts are disabled (in the processor status word register) for access time, i.e.
disable_interrupts();
enable_interrupts();
However, there are also βflagsβ that are shared without protection, which are set in interrupts and are interrogated in the user code as follows:
volatile unsigned char event_request_message = 0;
unsigned char condition_sending_message = 0;
#pragma interrupt
void on_request_message()
{
...
event_request_message = 1;
...
}
void user_code()
{
for(;;)
{
...
if(event_request_message && !condition_sending_message)
{
event_request_message = 0;
condition_sending_message = 1;
...
}
...
}
}
( ) :
: ? "" ?
/?
- , .
- , "" ( 0 1, ( )) ( , ..).
, ?
" "?
"" , .
, , .
PS. : "cc-rx", "rxv2-instruction-set", "rx231".