1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-06 21:54:15 +01:00

ET OSD: Adapt to new I2C API

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1316 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
FredericG 2010-08-18 09:31:54 +00:00 committed by FredericG
parent 4cba4929c2
commit be2f5bbf70

View File

@ -38,11 +38,11 @@
// //
// Configuration // Configuration
// //
#define DEBUG_PORT PIOS_COM_TELEM_RF #define DEBUG_PORT PIOS_COM_GPS
#define STACK_SIZE 1024 #define STACK_SIZE 1024
#define TASK_PRIORITY (tskIDLE_PRIORITY + 3) #define TASK_PRIORITY (tskIDLE_PRIORITY + 3)
#define ENABLE_DEBUG_MSG #define ENABLE_DEBUG_MSG
#define DUMP_CONFIG // Enable this do read and dump the OSD config //#define DUMP_CONFIG // Enable this do read and dump the OSD config
//#define WRITE_CONFIG // Enable this do write and verify the OSD config //#define WRITE_CONFIG // Enable this do write and verify the OSD config
//#define DO_PAR_SEEK // Enable this to start a tool to find where parameters are encoded //#define DO_PAR_SEEK // Enable this to start a tool to find where parameters are encoded
@ -959,13 +959,19 @@ static void Task(void* parameters)
#endif #endif
DEBUG_MSG("SendMsg ."); DEBUG_MSG("SendMsg .");
if (PIOS_I2C_LockDevice(5000 / portTICK_RATE_MS))
{ {
DEBUG_MSG("."); const struct pios_i2c_txn txn_list[] = {
PIOS_I2C_Transfer(I2C_Write, 0x30<<1, msg, sizeof(msg)); {
DEBUG_MSG("."); .addr = 0x30<<1,
PIOS_I2C_UnlockDevice(); .rw = PIOS_I2C_TXN_WRITE,
.len = sizeof(msg),
.buf = msg,
},
};
PIOS_I2C_Transfer(PIOS_I2C_MAIN_ADAPTER, txn_list, NELEMENTS(txn_list));
} }
DEBUG_MSG("\n\r"); DEBUG_MSG("\n\r");
cnt++; cnt++;