SimAVR
AVR Simulator
sim_cycle_timers.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "sim_avr.h"
#include "sim_cycle_timers.h"
#include "sim_time.h"
Include dependency graph for sim_cycle_timers.c:

Macros

#define QUEUE(__q, __e)
 
#define DETACH(__q, __l, __e)
 
#define INSERT(__q, __l, __e)
 
#define DEFAULT_SLEEP_CYCLES   1000
 

Functions

void avr_cycle_timer_reset (struct avr_t *avr)
 
static avr_cycle_count_t avr_cycle_timer_return_sleep_run_cycles_limited (avr_t *avr, avr_cycle_count_t sleep_cycle_count)
 
static void avr_cycle_timer_reset_sleep_run_cycles_limited (avr_t *avr)
 
static void avr_cycle_timer_insert (avr_t *avr, avr_cycle_count_t when, avr_cycle_timer_t timer, void *param)
 
void avr_cycle_timer_register (avr_t *avr, avr_cycle_count_t when, avr_cycle_timer_t timer, void *param)
 register for calling 'timer' in 'when' cycles More...
 
void avr_cycle_timer_register_usec (avr_t *avr, uint32_t when, avr_cycle_timer_t timer, void *param)
 register a timer to call in 'when' usec More...
 
void avr_cycle_timer_cancel (avr_t *avr, avr_cycle_timer_t timer, void *param)
 cancel a previously set timer More...
 
avr_cycle_count_t avr_cycle_timer_status (avr_t *avr, avr_cycle_timer_t timer, void *param)
 Check to see if a timer is present, if so, return the number (+1) of cycles left for it to fire, and if not present, return zero. More...
 
avr_cycle_count_t avr_cycle_timer_process (avr_t *avr)
 

Macro Definition Documentation

#define DEFAULT_SLEEP_CYCLES   1000
#define DETACH (   __q,
  __l,
  __e 
)
Value:
{ \
if (__l) \
(__l)->next = (__e)->next; \
else \
(__q) = (__e)->next; \
}
#define INSERT (   __q,
  __l,
  __e 
)
Value:
{ \
if (__l) { \
(__e)->next = (__l)->next; \
(__l)->next = (__e); \
} else { \
(__e)->next = (__q); \
(__q) = (__e); \
} \
}
#define QUEUE (   __q,
  __e 
)
Value:
{ \
(__e)->next = (__q); \
(__q) = __e; \
}

Function Documentation

static void avr_cycle_timer_insert ( avr_t avr,
avr_cycle_count_t  when,
avr_cycle_timer_t  timer,
void *  param 
)
static

Here is the caller graph for this function:

static void avr_cycle_timer_reset_sleep_run_cycles_limited ( avr_t avr)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static avr_cycle_count_t avr_cycle_timer_return_sleep_run_cycles_limited ( avr_t avr,
avr_cycle_count_t  sleep_cycle_count 
)
static

Here is the caller graph for this function: