aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/Incomplete/StandaloneProgrammer
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2012-02-28 20:40:24 +0000
committerDean Camera <dean@fourwalledcubicle.com>2012-02-28 20:40:24 +0000
commitbb85d083a7899890d0c14502078f6fa60a09d5df (patch)
tree64639b9495a86414aa0cc92917145b41a5f1562e /Projects/Incomplete/StandaloneProgrammer
parentb762780343dd505f7bfe5673cbcffb0b938d7064 (diff)
downloadlufa-bb85d083a7899890d0c14502078f6fa60a09d5df.tar.gz
lufa-bb85d083a7899890d0c14502078f6fa60a09d5df.tar.bz2
lufa-bb85d083a7899890d0c14502078f6fa60a09d5df.zip
Fix warnings and errors found by the new cppcheck provided static code analysis.
Diffstat (limited to 'Projects/Incomplete/StandaloneProgrammer')
-rw-r--r--Projects/Incomplete/StandaloneProgrammer/Lib/ProgrammerConfig.c6
-rw-r--r--Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.c19
2 files changed, 11 insertions, 14 deletions
diff --git a/Projects/Incomplete/StandaloneProgrammer/Lib/ProgrammerConfig.c b/Projects/Incomplete/StandaloneProgrammer/Lib/ProgrammerConfig.c
index 6a8419d35..917523669 100644
--- a/Projects/Incomplete/StandaloneProgrammer/Lib/ProgrammerConfig.c
+++ b/Projects/Incomplete/StandaloneProgrammer/Lib/ProgrammerConfig.c
@@ -40,7 +40,7 @@ struct
bool ProgrammerConfig_ProcessConfiguration(void)
{
- memset(&ProgrammerConfig, sizeof(ProgrammerConfig), 0x00);
+ memset(&ProgrammerConfig, 0x00, sizeof(ProgrammerConfig));
if (!(pf_open("CONF.txt") == FR_OK))
{
@@ -61,8 +61,8 @@ bool ProgrammerConfig_ProcessConfiguration(void)
&ProgrammerConfig.SigBytes[1],
&ProgrammerConfig.SigBytes[2],
&ProgrammerConfig.SigBytes[3]);
-
- sscanf(CurrentLine, "SPEED = %lu", &ProgrammerConfig.ProgrammingSpeed);
+
+ sscanf(CurrentLine, "SPEED = %08lu", &ProgrammerConfig.ProgrammingSpeed);
}
} while (CurrentLine);
diff --git a/Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.c b/Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.c
index 1f9f8391d..cc79a8321 100644
--- a/Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.c
+++ b/Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.c
@@ -114,18 +114,15 @@ int main(void)
{
Programmer_Task();
+ #if defined(USB_CAN_BE_HOST)
if (USB_CurrentMode == USB_MODE_Host)
- {
- #if defined(USB_CAN_BE_HOST)
- DiskHost_USBTask();
- #endif
- }
- else
- {
- #if defined(USB_CAN_BE_DEVICE)
- DiskDevice_USBTask();
- #endif
- }
+ DiskHost_USBTask();
+ #endif
+
+ #if defined(USB_CAN_BE_DEVICE)
+ if (USB_CurrentMode == USB_MODE_Device)
+ DiskDevice_USBTask();
+ #endif
USB_USBTask();
}