📄 main.c
字号:
//A inclure en premier
#include "pic.h"
#include "main.h"
#include "consts.h"
#include "envcar.h"
//#include "i_lm629.h"
#include "iPIC.h"
#include "math.h"
//Le compilo ne prend qu'un .c
//donc on inclus les autres
#include "envcar.c"
#include "i_lm629.c"
#include "cmd_LM629.c"
#include "iPIC.c"
void init()
{
//Ports en lecture
#ifndef SANS_PIC_BASIC
set_tris_a(0xFF);
#else
set_tris_a(0x00);
#endif
set_tris_b(0xFF);
//set_tris_c(0xE0); //commandes RD,WR,Csx,brake du lmd18200 et PS en sortie, le reste en entr閑.
set_tris_c(0xC0); //commandes RD,WR,Csx,brake du lmd18200 et PS en sortie, le reste en entr閑.
output_high(PIC_DATA); // La carte est en train de s'initialiser: on l'indique.
disable_interrupts(GLOBAL);
initEnvoi();
}
void main (void)
{
init();
delay_ms(1000);
purge_trace();
envoiCar("PRET");
envoiCar(CAR_PAUSE);
#ifndef SANS_PIC_BASIC
envoiCar("PIC");
envoiCar(CAR_PAUSE);
#endif
/*
while(1)
{
output_high(BRAKE_LMD);
delay_ms(5);
output_low(BRAKE_LMD);
delay_ms(5);
}
*/
initLM(); //Fonctionne et est OK!!!
envoiCar("LMOK");
output_low(PIC_DATA); //carte d'asservisement pr阾e!
#ifndef SANS_PIC_BASIC
While(1)
{
waitForCmd(); //Fonctionne
}
#else
testCmd();
#endif
envoiCar("FIN!");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -