Rev 489 | Rev 500 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 489 | Rev 492 | ||
---|---|---|---|
Line 901... | Line 901... | ||
901 | delay = 20; // next cycle after 20 ms |
901 | delay = 20; // next cycle after 20 ms |
902 | NCMAG_GetMagVector(5); |
902 | NCMAG_GetMagVector(5); |
903 | break; |
903 | break; |
904 | case TYPE_LSM303DLH: |
904 | case TYPE_LSM303DLH: |
905 | case TYPE_LSM303DLM: |
905 | case TYPE_LSM303DLM: |
906 | - | ||
- | 906 | delay = 20; // next cycle after 20 ms |
|
907 | if(s-- || (Compass_I2CPort == NCMAG_PORT_INTERN)) |
907 | if(s-- || (Compass_I2CPort == NCMAG_PORT_INTERN)) |
908 | { |
908 | { |
909 | delay = 20; // next cycle after 20 ms |
- | |
910 | NCMAG_GetMagVector(5); |
909 | NCMAG_GetMagVector(5); |
911 | } |
910 | } |
912 | else // having an external compass, read every 50th cycle the ACC vec |
911 | else // having an external compass, read every 50th cycle the ACC vec |
913 | { // try to initialize if no data are there |
912 | { // try to initialize if no data are there |
914 | if((AccRawVector.X + AccRawVector.Y + AccRawVector.Z) == 0) NCMAG_Init_ACCSensor(); |
913 | if((AccRawVector.X + AccRawVector.Y + AccRawVector.Z) == 0) NCMAG_Init_ACCSensor(); |
Line 1059... | Line 1058... | ||
1059 | AccRawVector.Z = 0; |
1058 | AccRawVector.Z = 0; |
Line 1060... | Line 1059... | ||
1060 | 1059 | ||
1061 | if(NCMAG_Present) // do only short init ! , full init was called before |
1060 | if(NCMAG_Present) // do only short init ! , full init was called before |
1062 | { |
1061 | { |
1063 | // reset I2C Bus |
1062 | // reset I2C Bus |
1064 | I2CBus_Deinit(Compass_I2CPort); |
1063 | //I2CBus_Deinit(Compass_I2CPort); |
1065 | I2CBus_Init(Compass_I2CPort); |
1064 | //I2CBus_Init(Compass_I2CPort); |
1066 | // try to reconfigure senor |
1065 | // try to reconfigure senor |
1067 | NCMAG_ConfigureSensor(); |
1066 | NCMAG_ConfigureSensor(); |
1068 | NCMAG_Update(1); |
1067 | //NCMAG_Update(1); |
1069 | } |
1068 | } |
1070 | else // full init |
1069 | else // full init |
1071 | { |
1070 | { |
1072 | u8 msg[64]; |
1071 | u8 msg[64]; |