running the indent on the files.
This commit is contained in:
@@ -40,60 +40,54 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#include "mstp.h"
|
||||
|
||||
// Transmits a Frame on the wire
|
||||
void RS485_Send_Frame(
|
||||
struct mstp_port_struct_t *mstp_port, // port specific data
|
||||
uint8_t *buffer, // frame to send (up to 501 bytes of data)
|
||||
uint16_t nbytes) // number of bytes of data (up to 501)
|
||||
void RS485_Send_Frame(struct mstp_port_struct_t *mstp_port, // port specific data
|
||||
uint8_t * buffer, // frame to send (up to 501 bytes of data)
|
||||
uint16_t nbytes) // number of bytes of data (up to 501)
|
||||
{
|
||||
|
||||
// in order to avoid line contention
|
||||
while (mstp_port->Turn_Around_Waiting)
|
||||
{
|
||||
// wait, yield, or whatever
|
||||
}
|
||||
// in order to avoid line contention
|
||||
while (mstp_port->Turn_Around_Waiting) {
|
||||
// wait, yield, or whatever
|
||||
}
|
||||
|
||||
// Disable the receiver, and enable the transmit line driver.
|
||||
// Disable the receiver, and enable the transmit line driver.
|
||||
|
||||
while (nbytes)
|
||||
{
|
||||
putc(*buffer,stderr);
|
||||
buffer++;
|
||||
nbytes--;
|
||||
}
|
||||
while (nbytes) {
|
||||
putc(*buffer, stderr);
|
||||
buffer++;
|
||||
nbytes--;
|
||||
}
|
||||
|
||||
// Wait until the final stop bit of the most significant CRC octet
|
||||
// has been transmitted but not more than Tpostdrive.
|
||||
// Wait until the final stop bit of the most significant CRC octet
|
||||
// has been transmitted but not more than Tpostdrive.
|
||||
|
||||
// Disable the transmit line driver.
|
||||
// Disable the transmit line driver.
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
// called by timer, interrupt(?) or other thread
|
||||
void RS485_Check_UART_Data(struct mstp_port_struct_t *mstp_port)
|
||||
{
|
||||
if (mstp_port->ReceiveError == true)
|
||||
{
|
||||
// wait for state machine to clear this
|
||||
}
|
||||
// wait for state machine to read from the DataRegister
|
||||
else if (mstp_port->DataAvailable == false)
|
||||
{
|
||||
// check for data
|
||||
if (mstp_port->ReceiveError == true) {
|
||||
// wait for state machine to clear this
|
||||
}
|
||||
// wait for state machine to read from the DataRegister
|
||||
else if (mstp_port->DataAvailable == false) {
|
||||
// check for data
|
||||
|
||||
// if error,
|
||||
// ReceiveError = TRUE;
|
||||
// return;
|
||||
// if error,
|
||||
// ReceiveError = TRUE;
|
||||
// return;
|
||||
|
||||
mstp_port->DataRegister = 0; // FIXME: Get this data from UART or buffer
|
||||
mstp_port->DataRegister = 0; // FIXME: Get this data from UART or buffer
|
||||
|
||||
// if data is ready,
|
||||
// DataAvailable = TRUE;
|
||||
// return;
|
||||
}
|
||||
// if data is ready,
|
||||
// DataAvailable = TRUE;
|
||||
// return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user