simple space style cleanup; fix case of bool; no functional change
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41165 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -74,7 +74,7 @@ BeceemDevice::ReadRegister(unsigned int reg, size_t size, uint32_t* buffer)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
} while ((result < 0) && (retries < MAX_USB_IO_RETRIES ) );
|
} while ((result < 0) && (retries < MAX_USB_IO_RETRIES));
|
||||||
|
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
TRACE_ALWAYS("Error: USB read request failure."
|
TRACE_ALWAYS("Error: USB read request failure."
|
||||||
@@ -122,7 +122,7 @@ BeceemDevice::WriteRegister(unsigned int reg, size_t size, uint32_t* buffer)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
} while ((result < 0) && (retries < MAX_USB_IO_RETRIES ) );
|
} while ((result < 0) && (retries < MAX_USB_IO_RETRIES));
|
||||||
|
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
TRACE_ALWAYS("Error: USB write request failure."
|
TRACE_ALWAYS("Error: USB write request failure."
|
||||||
@@ -409,9 +409,9 @@ BeceemDevice::Read(uint8 *buffer, size_t *numBytes)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
*numBytes = header[1] | ( header[2] << 8 );
|
*numBytes = header[1] | (header[2] << 8);
|
||||||
|
|
||||||
if (header[0] & 0xBF ) {
|
if (header[0] & 0xBF) {
|
||||||
TRACE_ALWAYS("RX error %d occured !\n", header[0]);
|
TRACE_ALWAYS("RX error %d occured !\n", header[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1019,9 +1019,9 @@ BeceemDevice::LoadConfig()
|
|||||||
struct stat cfgStat;
|
struct stat cfgStat;
|
||||||
int dtaread = 0;
|
int dtaread = 0;
|
||||||
|
|
||||||
int fh = open( FIRM_CFG, O_RDONLY );
|
int fh = open(FIRM_CFG, O_RDONLY);
|
||||||
|
|
||||||
if (fh == B_ERROR || fstat(fh, &cfgStat) < 0 ) {
|
if (fh == B_ERROR || fstat(fh, &cfgStat) < 0) {
|
||||||
TRACE_ALWAYS("Error: Unable to open the configuration at %s\n", FIRM_CFG);
|
TRACE_ALWAYS("Error: Unable to open the configuration at %s\n", FIRM_CFG);
|
||||||
return fh;
|
return fh;
|
||||||
}
|
}
|
||||||
@@ -1030,7 +1030,7 @@ BeceemDevice::LoadConfig()
|
|||||||
|
|
||||||
buffer=(unsigned int*)malloc(MAX_USB_TRANSFER);
|
buffer=(unsigned int*)malloc(MAX_USB_TRANSFER);
|
||||||
|
|
||||||
if ( !buffer ) {
|
if (!buffer) {
|
||||||
TRACE_ALWAYS("Error: Memory allocation error.\n");
|
TRACE_ALWAYS("Error: Memory allocation error.\n");
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
@@ -1135,9 +1135,9 @@ BeceemDevice::PushConfig(unsigned int loc)
|
|||||||
int chipwriteloc = 0;
|
int chipwriteloc = 0;
|
||||||
int readposition = 0;
|
int readposition = 0;
|
||||||
|
|
||||||
int fh = open( FIRM_CFG, O_RDONLY );
|
int fh = open(FIRM_CFG, O_RDONLY);
|
||||||
|
|
||||||
if (fh == B_ERROR || fstat(fh, &cfgStat) < 0 ) {
|
if (fh == B_ERROR || fstat(fh, &cfgStat) < 0) {
|
||||||
TRACE_ALWAYS("Error: Unable to open the configuration at %s\n", FIRM_CFG);
|
TRACE_ALWAYS("Error: Unable to open the configuration at %s\n", FIRM_CFG);
|
||||||
return fh;
|
return fh;
|
||||||
}
|
}
|
||||||
@@ -1149,7 +1149,7 @@ BeceemDevice::PushConfig(unsigned int loc)
|
|||||||
|
|
||||||
buffer=(unsigned int*)malloc(MAX_USB_TRANSFER);
|
buffer=(unsigned int*)malloc(MAX_USB_TRANSFER);
|
||||||
|
|
||||||
if ( !buffer ) {
|
if (!buffer) {
|
||||||
TRACE_ALWAYS("Error: Memory allocation error.\n");
|
TRACE_ALWAYS("Error: Memory allocation error.\n");
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
@@ -1179,7 +1179,7 @@ BeceemDevice::PushConfig(unsigned int loc)
|
|||||||
|
|
||||||
// As readposition should always be less then MAX_USB_TRANSFER
|
// As readposition should always be less then MAX_USB_TRANSFER
|
||||||
// and we have checked the validity of read's output above.
|
// and we have checked the validity of read's output above.
|
||||||
if ( WriteRegister(loc + chipwriteloc, readposition, buffer) != B_OK)
|
if (WriteRegister(loc + chipwriteloc, readposition, buffer) != B_OK)
|
||||||
{
|
{
|
||||||
TRACE_ALWAYS("Write failure\n");
|
TRACE_ALWAYS("Write failure\n");
|
||||||
result = B_ERROR;
|
result = B_ERROR;
|
||||||
@@ -1215,9 +1215,9 @@ BeceemDevice::PushFirmware(unsigned int loc)
|
|||||||
struct stat firmStat;
|
struct stat firmStat;
|
||||||
status_t result;
|
status_t result;
|
||||||
|
|
||||||
int fh = open( FIRM_BIN, O_RDONLY );
|
int fh = open(FIRM_BIN, O_RDONLY);
|
||||||
|
|
||||||
if (fh == B_ERROR || fstat(fh, &firmStat) < 0 ) {
|
if (fh == B_ERROR || fstat(fh, &firmStat) < 0) {
|
||||||
TRACE_ALWAYS("Error: Unable to open the firmware at %s\n", FIRM_BIN);
|
TRACE_ALWAYS("Error: Unable to open the firmware at %s\n", FIRM_BIN);
|
||||||
return fh;
|
return fh;
|
||||||
} else
|
} else
|
||||||
@@ -1234,7 +1234,7 @@ BeceemDevice::PushFirmware(unsigned int loc)
|
|||||||
// For the push we load the file into the buffer
|
// For the push we load the file into the buffer
|
||||||
buffer=(unsigned int*)malloc(MAX_USB_TRANSFER);
|
buffer=(unsigned int*)malloc(MAX_USB_TRANSFER);
|
||||||
|
|
||||||
if ( !buffer ) {
|
if (!buffer) {
|
||||||
TRACE_ALWAYS("Error: Memory allocation error.\n");
|
TRACE_ALWAYS("Error: Memory allocation error.\n");
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
@@ -1242,8 +1242,8 @@ BeceemDevice::PushFirmware(unsigned int loc)
|
|||||||
// TODO : Firmware Download : investigate this, SHADOW clearing thing causes a KDL atm
|
// TODO : Firmware Download : investigate this, SHADOW clearing thing causes a KDL atm
|
||||||
#if 0
|
#if 0
|
||||||
// Clear the NVM SHADOW signature always before fw download.
|
// Clear the NVM SHADOW signature always before fw download.
|
||||||
WriteRegister( EEPROM_CAL_DATA_INTERNAL_LOC-4, 1, 0);
|
WriteRegister(EEPROM_CAL_DATA_INTERNAL_LOC-4, 1, 0);
|
||||||
WriteRegister( EEPROM_CAL_DATA_INTERNAL_LOC-8, 1, 0);
|
WriteRegister(EEPROM_CAL_DATA_INTERNAL_LOC-8, 1, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// We have to spoon feed the data to the usb device as it is probbably too
|
// We have to spoon feed the data to the usb device as it is probbably too
|
||||||
@@ -1271,7 +1271,7 @@ BeceemDevice::PushFirmware(unsigned int loc)
|
|||||||
|
|
||||||
// As readposition should always be less then MAX_USB_TRANSFER
|
// As readposition should always be less then MAX_USB_TRANSFER
|
||||||
// and we have checked the validity of read's output above.
|
// and we have checked the validity of read's output above.
|
||||||
if ( WriteRegister(loc + chipwriteloc, readposition, buffer) != B_OK)
|
if (WriteRegister(loc + chipwriteloc, readposition, buffer) != B_OK)
|
||||||
{
|
{
|
||||||
TRACE_ALWAYS("Write failure\n");
|
TRACE_ALWAYS("Write failure\n");
|
||||||
result = B_ERROR;
|
result = B_ERROR;
|
||||||
|
|||||||
@@ -11,9 +11,11 @@
|
|||||||
* driver what GPIO led register is used for what device state.
|
* driver what GPIO led register is used for what device state.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
#include "BeceemLED.h"
|
#include "BeceemLED.h"
|
||||||
|
|
||||||
|
|
||||||
BeceemLED::BeceemLED()
|
BeceemLED::BeceemLED()
|
||||||
{
|
{
|
||||||
TRACE("Debug: Load LED handler\n");
|
TRACE("Debug: Load LED handler\n");
|
||||||
@@ -270,7 +272,7 @@ BeceemLED::LEDOff(unsigned int index)
|
|||||||
status_t
|
status_t
|
||||||
BeceemLED::LEDThread(void *cookie)
|
BeceemLED::LEDThread(void *cookie)
|
||||||
{
|
{
|
||||||
bool LEDisON = false;
|
bool ledactive = false;
|
||||||
BeceemLED *led = (BeceemLED *)cookie;
|
BeceemLED *led = (BeceemLED *)cookie;
|
||||||
|
|
||||||
// While the driver is active
|
// While the driver is active
|
||||||
@@ -326,14 +328,14 @@ BeceemLED::LEDThread(void *cookie)
|
|||||||
|
|
||||||
if (blink == true) {
|
if (blink == true) {
|
||||||
led->LEDOff(uiLedIndex);
|
led->LEDOff(uiLedIndex);
|
||||||
LEDisON = false;
|
ledactive = false;
|
||||||
snooze(500000);
|
snooze(500000);
|
||||||
led->LEDOn(uiLedIndex);
|
led->LEDOn(uiLedIndex);
|
||||||
LEDisON = true;
|
ledactive = true;
|
||||||
} else {
|
} else {
|
||||||
// else we just flip on the color it needs to be.
|
// else we just flip on the color it needs to be.
|
||||||
led->LEDOn(uiLedIndex);
|
led->LEDOn(uiLedIndex);
|
||||||
LEDisON = true;
|
ledactive = true;
|
||||||
snooze(500000);
|
snooze(500000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user