view gsm-fw/gpf/osl/os_tim_fl.c @ 456:6e54a3fb01b9

os_tim_fl.c: os_TimerInformation() done
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 23 Jun 2014 04:53:10 +0000
parents 2081103418e9
children 103b06ef644a
line wrap: on
line source

/*
 * This C module is a reconstruction based on the disassembly of
 * os_tim.obj in frame_na7_db_fl.lib from the Leonardo package.
 */

/* set of included headers from COFF symtab: */
#include <stdio.h>
#include "gpfconf.h"	/* FreeCalypso addition */
#include "../../nucleus/nucleus.h"
#include "typedefs.h"
#include "os.h"
#include "gdi.h"
#include "os_types.h"
#include "os_glob.h"

extern UNSIGNED TMD_Timer;
extern INT      TMD_Timer_State;

extern T_OS_TIMER_ENTRY TimerTable[];
extern T_OS_TIMER_TABLE_ENTRY *p_list[];

extern void os_Timeout(unsigned t_handle);
extern void timer_error(int err);

unsigned os_time_to_tick_multiplier = TIME_TO_TICK_TDMA_FRAME_MULTIPLIER;
unsigned os_tick_to_time_multiplier = TICK_TO_TIME_TDMA_FRAME_MULTIPLIER;

unsigned t_start_ticks;
T_OS_TIMER_TABLE_ENTRY *t_running;
int used_timers;
int next_t_handle;
int t_list_access;
int max_used_timers;
NU_SEMAPHORE TimSemCB;
NU_TIMER os_timer_cb;

GLOBAL LONG
os_set_tick(int os_system_tick)
{
	switch (os_system_tick) {
	case SYSTEM_TICK_TDMA_FRAME:
		os_time_to_tick_multiplier = TIME_TO_TICK_TDMA_FRAME_MULTIPLIER;
		os_tick_to_time_multiplier = TICK_TO_TIME_TDMA_FRAME_MULTIPLIER;
		return(OS_OK);
	case SYSTEM_TICK_10_MS:
		os_time_to_tick_multiplier = TIME_TO_TICK_10MS_MULTIPLIER;
		os_tick_to_time_multiplier = TICK_TO_TIME_10MS_MULTIPLIER;
		return(OS_OK);
	default:
		return(OS_ERROR);
	}
}

GLOBAL LONG
os_TimerInformation(USHORT Index, char *Buffer)
{
	static int t_info_read;

	if (t_info_read) {
		t_info_read = 0;
		return(OS_ERROR);
	}
	sprintf(Buffer, "Maximum %d of %d available timers running",
		max_used_timers, MaxSimultaneousTimer);
	t_info_read = 1;
	return(OS_OK);
}