indented using indent.sh script.

This commit is contained in:
skarg
2013-10-29 01:55:49 +00:00
parent e3da7d7fed
commit 56b65e9694
43 changed files with 785 additions and 659 deletions
+6 -10
View File
@@ -131,7 +131,8 @@ void RS485_Set_Interface(
* ALGORITHM: none
* NOTES: none
*****************************************************************************/
bool RS485_Interface_Valid(unsigned port_number)
bool RS485_Interface_Valid(
unsigned port_number)
{
HANDLE h = 0;
DWORD err = 0;
@@ -139,17 +140,12 @@ bool RS485_Interface_Valid(unsigned port_number)
char ifname[255] = "";
sprintf(ifname, "\\\\.\\COM%u", port_number);
h = CreateFile(
ifname,
GENERIC_READ | GENERIC_WRITE, 0,
NULL, OPEN_EXISTING, 0,
NULL);
h = CreateFile(ifname, GENERIC_READ | GENERIC_WRITE, 0, NULL,
OPEN_EXISTING, 0, NULL);
if (h == INVALID_HANDLE_VALUE) {
err = GetLastError();
if ((err == ERROR_ACCESS_DENIED) ||
(err == ERROR_GEN_FAILURE) ||
(err == ERROR_SHARING_VIOLATION) ||
(err == ERROR_SEM_TIMEOUT)) {
if ((err == ERROR_ACCESS_DENIED) || (err == ERROR_GEN_FAILURE) ||
(err == ERROR_SHARING_VIOLATION) || (err == ERROR_SEM_TIMEOUT)) {
status = true;
}
} else {
+2 -1
View File
@@ -68,7 +68,8 @@ extern "C" {
void RS485_Print_Error(
void);
bool RS485_Interface_Valid(unsigned port_number);
bool RS485_Interface_Valid(
unsigned port_number);
#ifdef __cplusplus