开发环境工具准备:
sudo apt install sdcc libvte-dev
#python写的工具:stcgal git地址:https://github.com/grigorig/stcgal
sudo pip3 install pyserial stcgal
sudo apt-get install tqdm
#在stcgal目录下
sudo ./setup.py build&&sudo ./setup.py install
Makefile:
CC = sdcc
CXX =
OBJECT=obj/app.ihx
CFLAGS = -mmcs51\
SRC= src/main.c
INCLUDE =
LIB =
FLTKLIB =
$(OBJECT):$(SRC)
$(CC) $(SRC) -o $(OBJECT) $(CFLAGS) $(INCLUDE) $(LIB) $(FLTKLIB)
make burn
#烧录,开发板需要断电后再开机才能烧录
burn:
sudo stcgal ${OBJECT} -P stc89
indent:
indent -linux ${SRC}
clean:
rm -f *.o $(OBJECT) $(OBJECT_ARM) $(OBJECT_PPC)
rm -f obj/*
windows与linux不同:
windows linux: #include <reg52.h> #include <8052.h> sbit LED = P0^0; #define LED P0_0; 关键字: interrupt __interrupt _at_ __at 数据类型: reentrant __reentrant small __near large __far data __data idata __idata pdata __pdata xdata __xdata code __code
我的问题:
1.#include "intrins.h"错误,无法使用_nop_(),_crol_()等函数