main.c

来自「hi everybody enjoy hi everybody enjoy hi」· C语言 代码 · 共 35 行

C
35
字号
// 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 + =
减小字号Ctrl + -
显示快捷键?