Rev 469 | Rev 472 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 469 | Rev 470 | ||
---|---|---|---|
Line 56... | Line 56... | ||
56 | #include <math.h> |
56 | #include <math.h> |
57 | #include <stdio.h> |
57 | #include <stdio.h> |
58 | #include <string.h> |
58 | #include <string.h> |
59 | #include "91x_lib.h" |
59 | #include "91x_lib.h" |
60 | #include "ncmag.h" |
60 | #include "ncmag.h" |
61 | #include "i2c.h" |
61 | #include "i2c1.h" |
62 | #include "i2c0.h" |
62 | #include "i2c0.h" |
Line 63... | Line 63... | ||
63 | 63 | ||
64 | #include "timer1.h" |
64 | #include "timer1.h" |
65 | #include "led.h" |
65 | #include "led.h" |
Line 753... | Line 753... | ||
753 | void NCMAG_Update(void) |
753 | void NCMAG_Update(void) |
754 | { |
754 | { |
755 | static u32 TimerUpdate = 0; |
755 | static u32 TimerUpdate = 0; |
756 | static s8 send_config = 0; |
756 | static s8 send_config = 0; |
757 | u32 delay = 20; |
757 | u32 delay = 20; |
758 | - | ||
- | 758 | // todo State Handling for both busses !! |
|
759 | if( (I2C_State == I2C_STATE_OFF) || !NCMAG_Present ) |
759 | if( (I2C1_State == I2C_STATE_OFF) || !NCMAG_Present ) |
760 | { |
760 | { |
761 | Compass_Heading = -1; |
761 | Compass_Heading = -1; |
762 | DebugOut.Analog[14]++; // count I2C error |
762 | DebugOut.Analog[14]++; // count I2C error |
763 | return; |
763 | return; |
764 | } |
764 | } |
Line 926... | Line 926... | ||
926 | I2C_BufferPnt = I2C0_Buffer; |
926 | I2C_BufferPnt = I2C0_Buffer; |
927 | I2C_ErrorPnt = &I2C0_Error; |
927 | I2C_ErrorPnt = &I2C0_Error; |
928 | } |
928 | } |
929 | else |
929 | else |
930 | { |
930 | { |
931 | I2C_WaitForEndOfTransmissionFunc = &I2C_WaitForEndOfTransmission; |
931 | I2C_WaitForEndOfTransmissionFunc = &I2C1_WaitForEndOfTransmission; |
932 | I2C_LockBufferFunc = &I2C_LockBuffer; |
932 | I2C_LockBufferFunc = &I2C1_LockBuffer; |
933 | I2C_TransmissionFunc = &I2C_Transmission; |
933 | I2C_TransmissionFunc = &I2C1_Transmission; |
934 | I2C_BufferPnt = I2C_Buffer; |
934 | I2C_BufferPnt = I2C1_Buffer; |
935 | I2C_ErrorPnt = &I2C_Error; |
935 | I2C_ErrorPnt = &I2C1_Error; |
936 | } |
936 | } |
937 | } |
937 | } |
Line 938... | Line 938... | ||
938 | 938 | ||
939 | //---------------------------------------------------------------- |
939 | //---------------------------------------------------------------- |