|
In lugnet.robotics.rcx.legos, Steve Hassenplug wrote:
> For some silly reason, I was browsing through the BrickOS code and I noticed
> this:
>
> void motor_a_dir(MotorDirection dir)
> {
> dm_a.dir = dm_a_pattern[dir];
> dlcd_hide(LCD_A_LEFT);
> dlcd_hide(LCD_A_RIGHT);
> if (dir == fwd || dir == brake)
> dlcd_show(LCD_A_RIGHT);
> else if (dir == rev || dir == brake)
> dlcd_show(LCD_A_LEFT);
> }
>
> Is that right, or has a problem already been found and corrected, here?
>
> Problem: what if (dir==brake)?
> I think only the right LCD arrow comes on. There should be no "else". The 2nd
> to last line should start with 'if' not 'else if'
This problem has been fixed in the most recent CVS source file (dmotor.c), but
as far as I can tell it hasn't been part of an offical release yet:
http://cvs.sourceforge.net/viewcvs.py/brickos/brickos/kernel/dmotor.c?r1=1.7&r2=1.8
Mark
|
|
Message is in Reply To:
| | Motor Display
|
| For some silly reason, I was browsing through the BrickOS code and I noticed this: void motor_a_dir(MotorDirection dir) { dm_a.dir = dm_a_pattern[dir]; dlcd_hide(LCD_A_LEFT); dlcd_hide(LCD_A_RIGHT); if (dir == fwd || dir == brake) (...) (21 years ago, 5-Jan-04, to lugnet.robotics.rcx.legos)
|
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|