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

📄 main.c

📁 hi everybody enjoy hi everybody enjoy hi everybody enjoy hi everybody enjoy hi everybody enjoy hi ev
💻 C
字号:
// MemTestLib Demonstration Project
// For the Phytec Development Board with 87C591 phyCORE module
// using the Keil 8051 C Compiler or Raisonance 8051 C Compiler
// (C) Embedded Systems Academy 2000
// Version 1.00 Written by AA 7/31/00

// This program demonstrates the 8051 port of the Memory Test Library
// written by Michael Barr
//
// The library consists of four functions:
//
// extern datum memTestDataBus(volatile datum xdata * address);
//   - tests the data bus
// extern datum xdata *memTestAddressBus(volatile datum xdata * baseAddress, unsigned long nBytes);
//   - tests the address bus
// extern datum xdata *memTestDevice(volatile datum xdata * baseAddress, unsigned long nBytes);
//   - tests the memory device
// extern int memTest(void);
//   - performs all three tests in order and returns a pass or fail result

#include "memtestlib.h"

unsigned char xdata *LEDs = (unsigned char xdata *)0xFFA0;

void main(void)
{
  *LEDs = 0x00;                               // turn leds off
  if (!memTest())
    *LEDs |= 0x10;                            // test passed: turn led d1 on
  else
    *LEDs |= 0x20;                            // test failed: turn led d2 on
  while(1);
}
 

⌨️ 快捷键说明

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