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

📄 target.c

📁 hreadx实时嵌入式操作系统源代码,ARM移植. threadx是一个很好的多任务实时嵌入式操作系统
💻 C
字号:
/**************************************************************************/ 
/*                                                                        */ 
/*      only for 32bit mode and dosn't support interrupt nesting          */
/*                                                                        */  
/* File name:               threadX_cpu.c								  */
/* Last modified Date:      2008-03-28									  */
/* Last Version:            0.01										  */
/* Descriptions:            											  */
/* QQ:                      307102293									  */
/* ENAIL:                   wodexinxiang1949@163.com                      */
/*                                                                        */
/**************************************************************************/
#include "config.h"

#define __TX_SYS_STATCK             512
#define __TX_SVC_STATCK             512
#define __TX_IRQ_STATCK             512
#define __TX_FIQ_STATCK             512
#define __TX_ABOUT_STATCK           512
#define __TX_UDEF_STATCK            512

static int     _tx_SYS_statck[__TX_SYS_STATCK];
static int     _tx_SVC_statck[__TX_SVC_STATCK];
static int     _tx_IRQ_statck[__TX_IRQ_STATCK];
static int     _tx_FIQ_statck[__TX_FIQ_STATCK];
static int     _tx_ABOUT_tatck[__TX_ABOUT_STATCK];
static int     _tx_UNDEF_statck[__TX_UDEF_STATCK];

int    *__ptx_sys_statck    = &_tx_SYS_statck[__TX_SYS_STATCK - 1];
int    *__ptx_svc_statck    = &_tx_SVC_statck[__TX_SVC_STATCK - 1];
int    *__ptx_irq_statck    = &_tx_IRQ_statck[__TX_IRQ_STATCK - 1];
int    *__ptx_fiq_statck    = &_tx_FIQ_statck[__TX_FIQ_STATCK - 1];
int    *__ptx_about_statck  = &_tx_ABOUT_tatck[__TX_ABOUT_STATCK - 1];
int    *__ptx_undef_statck  = &_tx_UNDEF_statck[__TX_UDEF_STATCK - 1];


__align (0x40000) unsigned char    cFramBuffer[640][480][2];
unsigned char   *pucFrameBuffer =  &cFramBuffer[0][0][0];
/**************************************************************************/
/*                                                                        */ 
/*                                                                        */ 
/*                                                                        */
/**************************************************************************/
void Timer0_Exception (void)
{
    _tx_timer_interrupt();
    rSRCPND 	= 1<<10;
    rINTPND 	= rINTPND;
}

void  tickInit (void)
{
    HandleTIMER0    = (int)Timer0_Exception;
    rTCFG0          =  0;
    rTCFG1          =  1;
    rTCNTB0         = (PCLK / (4 * 200)) - 1;
    rTCON           = (1 << 1);
    rTCON           = (1 << 0) | (1 << 3);
    rSRCPND         = (1 << 10);
    rINTPND		    = (1 << 10);
    rINTMSK        &= ~(1 << 10);
}

void  targetInit (void)
{
    tickInit();
}
/**************************************************************************/
/*     The implementations for some library functions For more details,   */
/*     please refer to the ADS compiler handbook and The library function */
/*     manual User could change it as needed                              */
/**************************************************************************/

#include "rt_sys.h"
#include "stdio.h"

#pragma import(__use_no_semihosting_swi)
#pragma import(__use_two_region_memory)

        int __rt_div0(int a)
{
    a = a;
    return 0;
}

        int fputc(int ch,FILE *f)
{
    ch = ch;
    f = f;
    return 0;
}

    int fgetc(FILE *f)
{
    f = f;
    return 0;
}


        int _sys_close(FILEHANDLE fh)
{
    fh = fh;
    return 0;
}

        int _sys_write(FILEHANDLE fh, const unsigned char * buf,
                      unsigned len, int mode)
{
    fh = fh;
    buf = buf;
    len =len;
    mode = mode;
    return 0;
}
        int _sys_read(FILEHANDLE fh, unsigned char * buf,
                     unsigned len, int mode)
{
    fh = fh;
    buf = buf;
    len =len;
    mode = mode;
    
    return 0;
}

       void _ttywrch(int ch)
{
    ch = ch;
}

        int _sys_istty(FILEHANDLE fh)
{
    fh = fh;
    return 0;
}
        int _sys_seek(FILEHANDLE fh, long pos)
{
    fh = fh;
    return 0;
}
        int _sys_ensure(FILEHANDLE fh)
{
    fh = fh;
    return 0;
}

        long _sys_flen(FILEHANDLE fh)
{
    fh = fh;
    return 0;
}
       int _sys_tmpnam(char * name, int sig, unsigned maxlen)
{
    name = name;
    sig = sig;
    maxlen = maxlen;
    return 0;
}

        void _sys_exit(int returncode)
{
    returncode = returncode;
}

        char *_sys_command_string(char * cmd, int len)
{
    cmd = cmd;
    len = len;
    return 0;
}
/**************************************************************************/
/*     end of file                                                        */ 
/**************************************************************************/

⌨️ 快捷键说明

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