mirror of
https://github.com/eddyem/stm32samples.git
synced 2026-03-22 01:31:21 +03:00
SteppersCAN: add CAN & start working on steppers
This commit is contained in:
@@ -367,7 +367,7 @@ static void can_process_fifo(uint8_t fifo_num){
|
||||
/* TODO: check filter match index if more than one ID can receive */
|
||||
CAN_message msg;
|
||||
uint8_t *dat = msg.data;
|
||||
uint8_t len = box->RDTR & 0x7;
|
||||
uint8_t len = box->RDTR & 0x0f;
|
||||
msg.length = len;
|
||||
msg.ID = box->RIR >> 21;
|
||||
//msg.filterNo = (box->RDTR >> 8) & 0xff;
|
||||
|
||||
@@ -167,7 +167,7 @@ static CAN_message *parseCANmsg(char *txt){
|
||||
return NULL;
|
||||
}
|
||||
canmsg.ID = (uint16_t)(N&0x7ff);
|
||||
SEND("ID="); printuhex(canmsg.ID); newline();
|
||||
//SEND("ID="); printuhex(canmsg.ID); newline();
|
||||
ctr = 0;
|
||||
continue;
|
||||
}
|
||||
@@ -546,7 +546,6 @@ void printuhex(uint32_t val){
|
||||
uint8_t *ptr = (uint8_t*)&val + 3;
|
||||
int8_t i, j;
|
||||
for(i = 0; i < 4; ++i, --ptr){
|
||||
if(*ptr == 0 && i != 3) continue; // omit leading zeros
|
||||
for(j = 1; j > -1; --j){
|
||||
uint8_t half = (*ptr >> (4*j)) & 0x0f;
|
||||
if(half < 10) bufputchar(half + '0');
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user