📄 main.c
字号:
//*----------------------------------------------------------------------------
//*
//* Program: COM Port Test Program for Sat. board control protocol
//* Designed by: Elessar
//* CORE: ARM 7
//*
//*
//*
//*
//*
//* 1.0 26/Jun/09 : Creation
//* 1.1 21/Feb/05 : Update
//*----------------------------------------------------------------------------
//*----------------------------------------------------------------------------
//*----------------------------------------------------------------------------
//* EXTERNAL HARDWARE SPECIFICATION:
//*----------------------------------------------------------------------------
//* COM - Port specification
//* Baud rate: 38400
//* Bits: 8
//* Start: 1
//* Stop: 1
//* Parity: none
//*
//*----------------------------------------------------------------------------
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Include Standard LIB files
#include "Board.h"
//* Waiting time between LED1 and LED2
#define WAIT_TIME MCK
#define M0 (1<<0)
#define M1 (1<<1)
#define M2 (1<<2)
#define M3 (1<<3)
#define M4 (1<<4)
#define M5 (1<<5)
#define M6 (1<<6)
#define M7 (1<<7)
#define M8 (1<<8)
#define M9 (1<<9)
#define M10 (1<<10)
#define M11 (1<<11)
#define M12 (1<<12)
#define M13 (1<<13)
#define M14 (1<<14)
#define M15 (1<<15)
#define M16 (1<<16)
#define M17 (1<<17)
#define M18 (1<<18)
#define M19 (1<<19)
#define M20 (1<<20)
#define M21 (1<<21)
#define M22 (1<<22)
#define M23 (1<<23)
#define M24 (1<<24)
#define M25 (1<<25)
#define M26 (1<<26)
#define M27 (1<<27)
#define M28 (1<<28)
#define M29 (1<<29)
#define M30 (1<<30)
#define M31 (1<<31)
#define USART_INTERRUPT_LEVEL 7
#define AT91_BAUD_RATE (38400)
//#define AT91_BAUD_RATE (38400/2)
#define BRD (MCK/16/38400)
//* Global variable
int temp;
int temp2;
unsigned short int ARR_COL, ARR_ROW;
char ARRAY_auxiliary[3][20];
char MEMORY_DATA[2048];
struct _ControlSystem
{
char condition; //ni
char current_command;
unsigned short int number_of_bytes;
unsigned int start_address;
unsigned int current_address;
unsigned int end_address;
unsigned short int received_command_array_id; //array id, values 0-3
char data_counter; //Command data counter, values 0x0-0xF;
unsigned receiving_new_command: 1;
unsigned new_command_recieved: 1;
unsigned saving_data_flag: 1;
unsigned data_was_saved: 1;
unsigned loading_data_flag: 1;
unsigned saving_data_permitted: 1;
} ControlReg;
// Use the Library Handler defined in file periph/pio/pio_irq/irq_pio.s
// External Function Prototype
//*----------------------------------------------------------------------------
void save_data_to_memory (char receiving_data)
{
//----------------------------------------------------------------------------
//EN: this part of a program recieves command
//RU: 蒡
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -