Index: firmware/App/Services/Messaging.c =================================================================== diff -u -r772fdd144e4006fada12a2e91519378b29d54bae -r01892698468068bb97a80a84c96a6d7c5d6fde9b --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision 772fdd144e4006fada12a2e91519378b29d54bae) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision 01892698468068bb97a80a84c96a6d7c5d6fde9b) @@ -18,11 +18,10 @@ #include #include // For memcpy() -#include "reg_system.h" // Used to access system register to reset processor on request - #include "Compatible.h" #include "Messaging.h" #include "OperationModes.h" +#include "PAL.h" #include "Utilities.h" /** @@ -164,9 +163,9 @@ // Add 8-bit CRC data[ msgSize++ ] = crc; - // Pad with zero bytes to get length a multiple of CAN_MESSAGE_PAYLOAD_SIZE (8) - sizeMod = msgSize % CAN_MESSAGE_PAYLOAD_SIZE; - sizePad = ( sizeMod == 0 ? 0 : CAN_MESSAGE_PAYLOAD_SIZE - sizeMod ); + // Pad with zero bytes to get length a multiple of CAN_FRAME_PAYLOAD_SIZE (8) + sizeMod = msgSize % CAN_FRAME_PAYLOAD_SIZE; + sizePad = ( sizeMod == 0 ? 0 : CAN_FRAME_PAYLOAD_SIZE - sizeMod ); for ( i = 0; i < sizePad; i++ ) { data[ msgSize++ ] = 0; @@ -481,8 +480,8 @@ // Verify payload length if ( 0 == message->hdr.payloadLen ) { // S/w reset of processor - result = TRUE; // Reset will prevent this from getting transmitted though - systemREG1->SYSECR = (0x2) << 14; // Reset processor + result = TRUE; // Reset will prevent this from getting transmitted though + setSystemREG1_SYSECR( (0x2) << 14 ); // Reset processor } sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result );