Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000102 [ethersex] Bug minor always 2010-06-08 13:40 2010-06-12 14:43
Reporter murdok View Status public  
Assigned To stettberger
Priority normal Resolution fixed  
Status resolved  
Summary 0000102: ECMD parser for lcd_init is not correct if built without TEENSY_SUPPORT
Description lcd_init or lcd reinit in ECMD language is expected to use 2 parameters (cursor ON/OFF and blink ON/OFF).
If you build without TEENSY_SUPPORT and try to run 'lcd reinit 0 1' on ECMD prompt for example you get 'parse error'.

Problem is in lcd_init parser code at parameter count checking. It has to be changed as shown below:

--- hardware/lcd_bak/ecmd.c 2010-06-08 13:25:06.000000000 +0200
+++ hardware/lcd/ecmd.c 2010-06-07 13:56:07.000000000 +0200
@@ -139,7 +139,7 @@ int16_t parse_cmd_lcd_init(char *cmd, ch
        cursor = atoi(cmd);
 #else
        int ret = sscanf_P(cmd, PSTR("%u %u"), &cursor, &blink);
- if(ret == 2)
+ if(ret != 2)
                return ECMD_ERR_PARSE_ERROR;
 #endif


Maybe you could also check for EOF in returning value to see if sscanf finished without findings, cause i don't know your exact intension.

Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0000093)
VBen (reporter)
2010-06-10 21:02

Thanks for the fix
(0000097)
stettberger (manager)
2010-06-12 14:43

Thank you for reporting. This is surely a bug. I fixed as you proposed.

- Issue History
Date Modified Username Field Change
2010-06-08 13:40 murdok New Issue
2010-06-10 21:00 VBen Issue Monitored: VBen
2010-06-10 21:02 VBen Note Added: 0000093
2010-06-12 14:43 stettberger Note Added: 0000097
2010-06-12 14:43 stettberger Assigned To => stettberger
2010-06-12 14:43 stettberger Status new => resolved
2010-06-12 14:43 stettberger Resolution open => fixed


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker