|
Atlas Runtime
|
#include <pthread.h>#include <stdio.h>#include <string.h>#include <sys/time.h>#include "atlas_alloc.h"#include "atlas_api.h"
Classes | |
| struct | AlarmClockInfo |
Macros | |
| #define | AC_TABLE_SIZE 32 |
| #define | AC_TABLE_MASK (AC_TABLE_SIZE - 1) |
| #define | AC_TABLE_ENTRY(hour, min) (AlarmClockTab + (((hour) + (min)) & AC_TABLE_MASK)) |
| #define | AC_LOCK(hour, min) (AlarmClockLockTab + (((hour) + (min)) & AC_TABLE_MASK)) |
Typedefs | |
| typedef struct AlarmClockInfo | AlarmClockInfo |
Functions | |
| AlarmClockInfo * | CreateNewInfo (uint8_t hour, uint8_t min, uint8_t mode, uint8_t repeat_factor, char *name) |
| int | add_or_update_alarm (uint8_t hour, uint8_t min, uint8_t mode, uint8_t repeat_factor, char *name) |
| int | cancel_alarm (uint8_t hour, uint8_t min, int play) |
| void | print_alarms () |
| void * | play_alarms () |
| void | initialize () |
| int | main () |
Variables | |
| AlarmClockInfo ** | AlarmClockTab |
| pthread_mutex_t | AlarmClockLockTab [AC_TABLE_SIZE] |
| int | set_alarms = 0 |
| int | update_alarms = 0 |
| int | cancelled_alarms = 0 |
| int | failed_cancel_alarms = 0 |
| uint32_t | alarm_clock_rgn_id |
| #define AC_LOCK | ( | hour, | |
| min | |||
| ) | (AlarmClockLockTab + (((hour) + (min)) & AC_TABLE_MASK)) |
| #define AC_TABLE_ENTRY | ( | hour, | |
| min | |||
| ) | (AlarmClockTab + (((hour) + (min)) & AC_TABLE_MASK)) |
| #define AC_TABLE_MASK (AC_TABLE_SIZE - 1) |
| #define AC_TABLE_SIZE 32 |
| typedef struct AlarmClockInfo AlarmClockInfo |
| int add_or_update_alarm | ( | uint8_t | hour, |
| uint8_t | min, | ||
| uint8_t | mode, | ||
| uint8_t | repeat_factor, | ||
| char * | name | ||
| ) |
| int cancel_alarm | ( | uint8_t | hour, |
| uint8_t | min, | ||
| int | play | ||
| ) |
| AlarmClockInfo* CreateNewInfo | ( | uint8_t | hour, |
| uint8_t | min, | ||
| uint8_t | mode, | ||
| uint8_t | repeat_factor, | ||
| char * | name | ||
| ) |
| void initialize | ( | ) |
| int main | ( | ) |
| void* play_alarms | ( | ) |
| void print_alarms | ( | ) |
| uint32_t alarm_clock_rgn_id |
| pthread_mutex_t AlarmClockLockTab[AC_TABLE_SIZE] |
| AlarmClockInfo** AlarmClockTab |
| int cancelled_alarms = 0 |
| int failed_cancel_alarms = 0 |
| int set_alarms = 0 |
| int update_alarms = 0 |