📄 main.c
字号:
#include <p24fj128ga106.h>
_CONFIG1(JTAGEN_OFF & GCP_OFF & GWRP_OFF & BKBUG_OFF & COE_OFF & ICS_PGx1 & FWDTEN_OFF & WINDIS_OFF & FWPSA_PR32 & WDTPS_PS32768)
_CONFIG2(IESO_OFF & FNOSC_FRCPLL & FCKSM_CSDCMD & OSCIOFNC_ON & IOL1WAY_OFF & POSCMOD_NONE)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdio.h>
#include <errno.h>
#include "HardwareProfile.h"
#include "Delay.h"
#include "comm.h"
#include "monitor.h"
int main(void)
{
char c;
_DOZEN = 0;
_RCDIV2 = 0;
_RCDIV1 = 0;
_RCDIV0 = 0;
asm volatile ( "MOV #OSCCON, w1 \n"
"MOV #0x46, w2 \n"
"MOV #0x57, w3 \n"
"MOV.b w2, [w1] \n"
"MOV.b w3, [w1] \n"
"BCLR OSCCON,#6");
AD1PCFGL = 0xffff;
REDLED = 0;
REDLED_TRIS = 0;
GREENLED = 0;
GREENLED_TRIS = 0;
RPINR18bits.U1RXR = 10;
RPOR8bits.RP17R = 3;
// Lock Registers
asm volatile ( "MOV #OSCCON, w1 \n"
"MOV #0x46, w2 \n"
"MOV #0x57, w3 \n"
"MOV.b w2, [w1] \n"
"MOV.b w3, [w1] \n"
"BSET OSCCON, #6" );
uart_init(); /* Initialize UART driver */
xputs("\nFatFs module test monitor for PIC24F\n");
while(1)
{
c = xgetc();
xputc (c);
REDLED ^= 1;
GREENLED ^= 1;
DelayMs(250);
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -