View Single Post
Old 04-03-2011, 12:39 PM   #670 (permalink)
gone.s2
EcoModding Lurker
 
Join Date: Mar 2011
Posts: 15

der Öl-Brenner - '01 Volkswagen Jetta TDI
Thanks: 0
Thanked 0 Times in 0 Posts
Nevermind about the reinit issues. I suspected the same lethargy problem I was seeing previously was causing the call to get_pid(PID_SUPPORT00...) to fail, and that proved to be the case. Adding a retry loop in check_supported_pids() to this call resolved my issue.

Code:
void check_supported_pids(void)
{
  char str[STRLEN];

#ifdef DEBUG
  pid01to20_support=0xBE1FA812;
#else
  byte i=0; << ADDED
  while (i<3 && !pid01to20_support) << ADDED
  { << ADDED
    i++; << ADDED
    pid01to20_support  = (get_pid(PID_SUPPORT00, false, str, &tempLong)) ? tempLong : 0;
  } << ADDED
#endif

Also, my statement about 300ms working for time between init sequences doesn't seem to stand in re-init.

EDIT: Actually, this works better because the pid01to20_support doesn't need to be zeroed out.

Code:
  byte i=0;
  do
  {
    i++;
    pid01to20_support  = (get_pid(PID_SUPPORT00, false, str, &tempLong)) ? tempLong : 0;
  } while (i<3 && !pid01to20_support);

Last edited by gone.s2; 04-03-2011 at 11:00 PM..
  Reply With Quote