common/rb.c
/* 
  Prototype:
    int rb_get(rb_t *rb)

  Description:
    Get data out of the ring buffer and remove this data item from the ring buffer.

  Precondition:
    rb_init() must be called on the "rb" argument.

  Parameter:
    rb: 	Address of a (initialized) buffer data structure

  Return:
    -1 if there is no data available, otherwise the data which was added before.
    
*/


Get data out of the ring buffer and remove this data item from the ring buffer.

rb_init() must be called on the "rb" argument.

Address of a (initialized) buffer data structure

1 if there is no data available, otherwise the data which was added before.
Get data out of the ring buffer and remove this data item from the ring buffer . rb_init () must be called on the " rb " argument . Address of a ( initialized ) buffer data structure 1 if there is no data available otherwise the data which was added before .
int rb_get(rb_t *rb)
{
  uint32_t primask;
  int data;
  if ( rb->end == rb->start )
    return -1;
  primask = __get_PRIMASK();	
  __disable_irq();			
  data = rb->ptr[rb->start];
  rb->start = rb_next_val(rb, rb->start);
  __set_PRIMASK(primask);	
  return data;  
}
int rb_get ( rb_t * rb ) { uint32_t primask ; int data ; if ( rb -> end == rb -> start ) return -1 ; primask = __get_PRIMASK ( ) ; __disable_irq ( ) ; data = rb -> ptr [ rb -> start ] ; rb -> start = rb_next_val ( rb , rb -> start ) ; __set_PRIMASK ( primask ) ; return data ; }
Prototype:
int rb_get(rb_t *rb)
Prototype : int rb_get ( rb_t * rb )
/* get the interrupt status */ /* disable IRQs, this will modify PRIMASK */ /* restore interrupt state */