From: Brendan Le Foll Date: Tue, 6 Oct 2015 10:51:00 +0000 (+0100) Subject: mraa_func.h: Remove unused code X-Git-Tag: v0.9.0~54 X-Git-Url: http://review.tizen.org/git/?p=contrib%2Fmraa.git;a=commitdiff_plain;h=529cf8a26ebef900ab145c0d1b6319d7ddf3376d mraa_func.h: Remove unused code Code crept in from ft4222 branch merge and is superflous becuase of the new advance function structure Signed-off-by: Brendan Le Foll --- diff --git a/include/mraa_func.h b/include/mraa_func.h deleted file mode 100644 index 094d848..0000000 --- a/include/mraa_func.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Author: Henry Bruce - * Copyright (c) 2015 Intel Corporation. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#pragma once - -#include "common.h" -#include "mraa.h" -#include "types.h" - -typedef struct { - mraa_i2c_context (*i2c_init_raw) (unsigned int bus); - mraa_result_t (*i2c_frequency) (mraa_i2c_context dev, mraa_i2c_mode_t mode); - mraa_result_t (*i2c_address) (mraa_i2c_context dev, uint8_t addr); - int (*i2c_read) (mraa_i2c_context dev, uint8_t* data, int length); - uint8_t (*i2c_read_byte) (mraa_i2c_context dev); - uint8_t (*i2c_read_byte_data) (mraa_i2c_context dev, const uint8_t command); - uint16_t (*i2c_read_word_data) (mraa_i2c_context dev, const uint8_t command); - int (*i2c_read_bytes_data) (mraa_i2c_context dev, uint8_t command, uint8_t* data, int length); - mraa_result_t (*i2c_write) (mraa_i2c_context dev, const uint8_t* data, int length); - mraa_result_t (*i2c_write_byte) (mraa_i2c_context dev, const uint8_t data); - mraa_result_t (*i2c_write_byte_data) (mraa_i2c_context dev, const uint8_t data, const uint8_t command); - mraa_result_t (*i2c_write_word_data) (mraa_i2c_context dev, const uint16_t data, const uint8_t command); - mraa_result_t (*i2c_stop) (mraa_i2c_context dev); -} mraa_i2c_func_t; - - -typedef struct { - mraa_i2c_func_t* i2c; -} mraa_func_t; - diff --git a/include/mraa_internal_types.h b/include/mraa_internal_types.h index 844509f..640fb38 100644 --- a/include/mraa_internal_types.h +++ b/include/mraa_internal_types.h @@ -27,7 +27,6 @@ #include "common.h" #include "mraa.h" -#include "mraa_func.h" #include "mraa_adv_func.h" #include "iio.h" diff --git a/src/mraa.c b/src/mraa.c index 3cacba3..f54eaab 100644 --- a/src/mraa.c +++ b/src/mraa.c @@ -50,7 +50,6 @@ mraa_board_t* plat = NULL; // static mraa_board_t* current_plat = NULL; static char platform_name[MAX_PLATFORM_NAME_LENGTH]; -mraa_adv_func_t* advance_func; static int num_i2c_devices = 0; static int num_iio_devices = 0; @@ -115,9 +114,6 @@ mraa_init() PyEval_InitThreads(); #endif - advance_func = (mraa_adv_func_t*) malloc(sizeof(mraa_adv_func_t)); - memset(advance_func, 0, sizeof(mraa_adv_func_t)); - mraa_platform_t platform_type; #if defined(X86PLAT) // Use runtime x86 platform detection