View Single Post
  #2   Spotlight this post!  
Unread 03-02-2004, 13:15
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,801
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: User_Autonomous_Code() questions

It's not you.

I think there have been quite a few late, late nights at IFI getting this stuff ready, and you know there's always a bug in software. You just may not know what it is yet.

We changed this around to where it made sense as you have done.
We decided to go through Process_Data_From_Master_uP() to check switches like the competition bit, then do the branch to auto or driver code.

Ours looks like:
Code:
    if (statusflag.NEW_SPI_DATA)      /* 26.2ms loop area */
    {                                 /* I'm slow!  I only execute every 26.2ms because */
                                      /* that's how fast the Master uP gives me data. */
      Getdata(&rxdata);   /* Get fresh data from the master microprocessor. */

      Process_Data_From_Master_uP();  /* Process switch/joystick changes */

      if (autonomous_mode)            /* DO NOT CHANGE! */
      {
        User_Autonomous_Code();    /* Autonomous drive controls */
      }
      else
      {
        User_Driver();                     /* User driver controls */
      }

      Generate_Pwms(pwm13,pwm14,pwm15,pwm16); /* N/A for EDU */

      Putdata(&txdata);             /* DO NOT CHANGE! */
    }

    Process_Data_From_Local_IO();
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 03-02-2004 at 14:22.