I2C. Testhal comment cleaned.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3693 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
2234fd3e31
commit
b581177630
|
@ -45,7 +45,7 @@ void I2CInit_pns(void){
|
||||||
|
|
||||||
/* startups. Pauses added just to be safe */
|
/* startups. Pauses added just to be safe */
|
||||||
chThdSleepMilliseconds(100);
|
chThdSleepMilliseconds(100);
|
||||||
// init_lis3();
|
/*init_lis3();*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ int init_lis3(void){
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void request_acceleration_data(void){
|
void request_acceleration_data(void){
|
||||||
accel_tx_data[0] = ACCEL_OUT_DATA | AUTO_INCREMENT_BIT; // register address
|
accel_tx_data[0] = ACCEL_OUT_DATA | AUTO_INCREMENT_BIT; /* register address */
|
||||||
i2cAcquireBus(&I2CD1);
|
i2cAcquireBus(&I2CD1);
|
||||||
i2cMasterTransmit(&I2CD1, lis3_addr, accel_tx_data, 1, accel_rx_data, 6, &errors, TIME_INFINITE);
|
i2cMasterTransmit(&I2CD1, lis3_addr, accel_tx_data, 1, accel_rx_data, 6, &errors, TIME_INFINITE);
|
||||||
i2cReleaseBus(&I2CD1);
|
i2cReleaseBus(&I2CD1);
|
||||||
|
|
|
@ -48,17 +48,17 @@ static msg_t Blink(void *arg) {
|
||||||
/*
|
/*
|
||||||
* Accelerometer thread
|
* Accelerometer thread
|
||||||
*/
|
*/
|
||||||
//static WORKING_AREA(PollAccelThreadWA, 256);
|
/*static WORKING_AREA(PollAccelThreadWA, 256);
|
||||||
//static msg_t PollAccelThread(void *arg) {
|
static msg_t PollAccelThread(void *arg) {
|
||||||
// chRegSetThreadName("PollAccel");
|
chRegSetThreadName("PollAccel");
|
||||||
// (void)arg;
|
(void)arg;
|
||||||
// while (TRUE) {
|
while (TRUE) {
|
||||||
//// chThdSleepMilliseconds(rand() & 31);
|
chThdSleepMilliseconds(rand() & 31);
|
||||||
// chThdSleepMilliseconds(32);
|
chThdSleepMilliseconds(32);
|
||||||
// request_acceleration_data();
|
request_acceleration_data();
|
||||||
// }
|
}
|
||||||
// return 0;
|
return 0;
|
||||||
//}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
/* Temperature polling thread */
|
/* Temperature polling thread */
|
||||||
|
@ -67,7 +67,7 @@ static msg_t PollTmp75Thread(void *arg) {
|
||||||
chRegSetThreadName("PollTmp75");
|
chRegSetThreadName("PollTmp75");
|
||||||
(void)arg;
|
(void)arg;
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
// chThdSleepMilliseconds(rand() & 31);
|
/*chThdSleepMilliseconds(rand() & 31);*/
|
||||||
chThdSleepMilliseconds(15);
|
chThdSleepMilliseconds(15);
|
||||||
/* Call reading function */
|
/* Call reading function */
|
||||||
request_temperature();
|
request_temperature();
|
||||||
|
@ -103,11 +103,11 @@ int main(void) {
|
||||||
I2CInit_pns();
|
I2CInit_pns();
|
||||||
|
|
||||||
/* Create accelerometer thread */
|
/* Create accelerometer thread */
|
||||||
// chThdCreateStatic(PollAccelThreadWA,
|
/*chThdCreateStatic(PollAccelThreadWA,
|
||||||
// sizeof(PollAccelThreadWA),
|
sizeof(PollAccelThreadWA),
|
||||||
// NORMALPRIO,
|
NORMALPRIO,
|
||||||
// PollAccelThread,
|
PollAccelThread,
|
||||||
// NULL);
|
NULL);*/
|
||||||
|
|
||||||
/* Create temperature thread */
|
/* Create temperature thread */
|
||||||
chThdCreateStatic(PollTmp75ThreadWA,
|
chThdCreateStatic(PollTmp75ThreadWA,
|
||||||
|
|
Loading…
Reference in New Issue