main.c

来自「用来计算不同oscillator下」· C语言 代码 · 共 95 行

C
95
字号
/*------------------------------------------------------------------------------
;  This file is part of the RLC instruction
;  Copyright (c)
;  Version: 1.0 
;-------------------------------------------------------------------------------
;  Filename:
;  main.c
;  Function:   
;
;  Author:
;  pirate
;     
;  Writedate:
;  Oct.15 2005
;  Moddate(latest):
;  Oct.15 2005
;-------------------------------------------------------------------------------
*/

//--------------------------------------
// Included files
//--------------------------------------
#include <reg52.h>		  //51head file
#include <intrins.h>	  //application function
#include ".\HEAD\dtype.h"
#include ".\HEAD\externf.h"

//--------------------------------------
// Local Definitions and Types
//--------------------------------------


/*******************************************************************************
/*   
//   Function:    main control
//
//!  Description: 
//!               - After a reset and power cycle the crystal is given time to
//!               settle and then it comes out of reset and then the radio is
//!               configured
//!
//!  Inputs:      None
//!
//!  Returns:     Void
/*
/*******************************************************************************
/*/
void main(void)
{
	uchar i;
	uchar j;
	
	uchar peninsula;
	uchar a[2][2] = {{1, 2}, {3, 4}};
	uchar (*p)[2];
	
	//Uart_init();
	//TR1 = 1;
	//TR2 = 1;
	nop();	     //nop function
	nop();
	p = a;
	peninsula = *(*(p + 0) + 0); // a[0][0];
	//CalBaudrate(0xDC);
	//TR2 = 1;
	//bomb = UartReceiveChar();
	//TR2 = 0;
	for(i = 0; i < 29; i++)		 //用这种方法可以很方便地计算出未知晶振频率的
	{							 //情况下,确定一波特率,所对应的计时器载入值
		CalBaudrate(i);
		TR2 = 1;
		UartSendChar(0x99);
		UartSendChar(i);
		UartSendChar(0x55);
		TR2 = 0;
		DelayXs(1);				     //delay 1 second
	}
	
    	  
	for(j = 0; j < 2; ++j)
	{
		test();
	}

	for (i=0;i<2;++i)
	{
		RlcChar(0x55);
		j = i;
	}

	//shifting every bit of a char 
	shiftchar();
	while(1);
}

⌨️ 快捷键说明

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