- 博客(1)
- 资源 (3)
- 收藏
- 关注
原创 【无标题】
实际项目经验分析jlink 远程调试环境搭建。VSCCODE+GDB+Jlink+实现远程调试,多人共享一套调试环境。该方式可实现,一套环境,多个开发远程调试。
2023-09-18 17:59:24
307
基于bios66ak核间中断演示程序
以核间中断(inter-processor interrupts)为例。实现通路如下:
1. System Event 105直接映射到 cpu中断,相对于System Event 105处理函数直接插入启动向量。
2. 通过事件合并, System Event 105合并到System Event 3,Event 3去触发中断,再通过合并事件状态机制跳转到System Event 105处理函数。
2016-04-22
ATMEGA8 沙盘控制程序
ATMEGA8 18路沙盘控制程序
void uart_init(void) //串口0初始化
{UCSR0B=0x00; //disable while setting baud rate
UCSR0A=0B00000000; //Bit1为1则倍速发送 U2X=0
UCSR0C=0x06; //B00000110 //奇偶模式无,八位数据位,一位停止位
UBRR0L=71; //B00011001波特率:4800 Bps
UBRR0H=0x00; //误差率:0.156%
UCSR0B=0x98;
recstate = recStart;
}
void putchar(unsigned char c) //串口0发送字符
{
while(!(UCSR0A&(1<< UDRE0))); //while(!(UCSR0A&32;)); 在此如何理解?
UDR0=c;
}
void putstr(unsigned char *s) //串口0发送字符串
{
while(*s)
{
putchar(*s);
s++;
}
}
#pragma interrupt_handler Uartms_Rx_Interrupt:iv_USART0_RX
/*--------------------------------------------------
功能:短信接收中断服务
入口:无
出口:无
--------------------------------------------------*/
void Uartms_Rx_Interrupt(void)
{
unsigned char rxdat;
static crctemp,conter = 0;
rxdat=UDR0;
switch(recstate)
{
case recStart:
if(rxdat == 0xaa)
{
recstate = recLong;
crctemp = 0;
}
break;
case recLong:
COMMURcv.inflong = rxdat;
recstate = recCMD;
break;
case recCMD:
COMMURcv.infCMD = rxdat;
recstate = recData;
break;
case recData:
if(rxdat == 0xaa)
{
COMMURcv.recOK = TRUE;
recstate = recStart;
}
recstate = recStart;
break;
default :
break;
}
}
bool sendchar(unsigned char sendchar)
{
unsigned char temp;
temp = sendchar>>4;
if(temp<10)
{
UartmsSnd.buff[0] = temp+'0';
}
else
{
UartmsSnd.buff[0] = temp+'A'-10;
}
temp = sendchar&0x0f;
if(temp<10)
{
UartmsSnd.buff[1] = temp+'0';
}
else
{
UartmsSnd.buff[1] = temp+'A'-10;
}
UartmsSnd.buff[2] = ' ';
UartmsSnd.buff[3] = 0;
putstr(UartmsSnd.buff);
return TRUE;
}
bool sendchar_enter(unsigned char sendchar)
{
unsigned char temp;
unsigned char uart_buf[16];
temp = sendchar/0x10;
if(temp<10)
{
uart_buf[0] = temp+'0';
}
else
{
uart_buf[0] = temp+'A'-10;
}
temp = sendchar%0x10;
if(temp<10)
{
uart_buf[1] = temp+'0';
}
else
{
uart_buf[1] = temp+'A'-10;
}
uart_buf[2] = '\n';
uart_buf[3] = '\r';
uart_buf[4] = 0;
putstr(uart_buf);
return TRUE;
}
2012-10-14
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人