⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 my_config.c

📁 基于ADI BLACKFIN的jbig压缩和解压缩程序
💻 C
字号:
#include <stdio.h>
#include <stdlib.h>

#include "my_config.h"

#include "myset.h"

#include "jsp_kernel.h"

#include "timer.h"


#include "task.h"


volatile BOOL btime_for_dispatch = FALSE;



static void mmr_config(void)
{
	register unsigned long *p = DADDR0;
	
	*p = 0xFF800000;
	
	p = DCPLB0;

	*p = 0x3001d;
	
	p = DADDR1;
	
	*p = 0;
	
	p = DCPLB1;
	
	*p = 0x3001d;
	
	p = DADDR2;
	
	*p = 0x400000;
	
	p = DCPLB2;
	
	*p = 0x3001d;
	
	p = MEM_CTRL;
	
	*p = 0x1003;
}





static void my_exp_rnt(void)
{
	puts("My exception occurred!");
	
	exit(-1);
}


#include "board_config.h"

void _kernel_call_inirtn(void)
{
	mmr_config();
	
	#ifdef _BOARD_TEST
	
	gpio_init();
	
	#endif
	
	// 4 ms per poll for time events and 8 ms per poll for task dispatch
	timer_initialize(
	#ifndef _BOARD_TEST
	10000
	#elif CPU_FREQ == FREQ_600MHz
	5033165UL
	#else		// FREQ_400MHz
	3355443UL
	#endif
	);
}


void _kernel_call_terrtn(void)
{
	
}




#include "cpu_config.h"

#include "mailbox.h"

#include "eventflag.h"

#include "semaphore.h"

#include "time_event.h"


void _kernel_object_initialize(void)
{		
	*pIMASK = 0x801f;
	
	task_initialize();
	
	mailbox_initialize();
	
	eventflag_initialize();
	
	semaphore_initialize();
	
	tmevt_initialize();
	
	aTicks[0] = 2;
	
	act_tsk(0);
}


extern void main(void);


const ID	tmax_tskid = 5;


UB aTicks[16]; 		// Time ticks for a task


TCB	tcb_table[16] = {/*task0*/ {/*queue table*/{ NULL, NULL }, 0, tinib_table, 0, 0, NULL }
				};

const ID	torder_table[] = { 0 };

TINIB	tinib_table[16] = { { 0, NULL, &main, 0, 2048, (void*)TASK0_STACK, 0, &my_exp_rnt }
						};



#include "cyclic.h"

const ID	tmax_cycid = 1;

const CYCINIB	cycinib_table[5] = {  };


CYCCB	cyccb_table[5] = {  };


#include "dataqueue.h"

const ID	tmax_dtqid = 1;

const DTQINIB	dtqinib_table[1];

DTQCB	dtqcb_table[1];


#include "exception.h"

const UINT	tnum_excno = 1;

const EXCINIB	excinib_table[1];



#include "eventflag.h"

const ID	tmax_flgid = 2;

const FLGINIB	flginib_table[2];


FLGCB	flgcb_table[1];


#include "interrupt.h"

const UINT	tnum_inhno = 1;

const INHINIB	inhinib_table[1];




const ID	tmax_mbxid = 1;

const MBXINIB	mbxinib_table[1];

MBXCB	mbxcb_table[1];


#include "mempfix.h"

const ID	tmax_mpfid = 1;

const MPFINIB	mpfinib_table[1];

MPFCB	mpfcb_table[1];


#include "semaphore.h"

const ID	tmax_semid = 2;

const SEMINIB	seminib_table[2] = {	{ 0, 0, 1 },
										{ 0, 0, 1 }
									};

SEMCB	semcb_table[2] = {	{ {NULL, NULL}, seminib_table },
							{ {NULL, NULL}, &seminib_table[1] }
						};


#include "time_event.h"

TMEVTN	tmevt_heap[2];

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -