Skip to content
Snippets Groups Projects
Commit e5b65ed0 authored by Torben Petersen's avatar Torben Petersen
Browse files

Fixes I2C usage

parent 5a205b62
No related branches found
No related tags found
No related merge requests found
......@@ -149,7 +149,7 @@ int shell_temp(int argc, char** argv) {
i2c_acquire(0);
//i2c_read_reg(0, 0x48, 0x00, &result);
i2c_read_regs(0, 0x48, 0x00, result, 2);
i2c_read_regs(0, 0x48, 0x00, result, 2, 0);
i2c_release(0);
//uint16_t temp = (result[0] << 8) | (result[1] >> 4);
//printf("temperature is %d %d\n", result[0], result[1]);
......@@ -509,11 +509,15 @@ void *send_thread(void *arg)
int main(void)
{
(void) puts("Welcome to RIOT!");
/// +1 -> INGA working, but TelosB/Sky not
thread_create(dump_thread_stack, sizeof(dump_thread_stack), THREAD_PRIORITY_MAIN + 1, THREAD_CREATE_STACKTEST, dump_thread, NULL, "dump_thread");
int res = i2c_init_master(I2C_DEV(0), 2);
printf("i2c init: %s\n", res == 0 ? "OK\n" : "FAILED\n");
//int res = i2c_init(I2C_DEV(0));
#if defined(BOARD_INGA_BLUE) || defined(BOARD_INGA_RED)
i2c_init(I2C_DEV(0));
#endif
//printf("i2c init: %s\n", res == 0 ? "OK\n" : "FAILED\n");
gnrc_netif_t *netif = NULL;
if((netif = gnrc_netif_iter(netif))) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment