aboutsummaryrefslogtreecommitdiffstats
path: root/binding/radio_impl_tef665x.c
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2020-09-08 18:38:10 -0400
committerScott Murray <scott.murray@konsulko.com>2020-09-08 18:43:20 -0400
commit8afc720a98e4fdf4f5c1f10492e465927b8ffd86 (patch)
tree4f88905908c9cd67b2177652f1ce0a00486f610e /binding/radio_impl_tef665x.c
parent4cdb281367813ffc12face0bbcba300fe6e7e2d3 (diff)
Changes: - Add null radio implementation that acts as the fallthrough default when the hardware implementations are not detected. - Tweaked the probing in the tef665x implementation to not return an error if the I2C node is not even present. This cleans up the logs on start up on most platforms. These changes include some minor whitespace consistency clean ups. - Added the run-by-default widget permission now that the binding should always work. This will ease testing, and potentially decrease app start up time. Bug-AGL: SPEC-3570 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I3c2e60ce7272d248ab87e3b79d6a334e17fe5531
Diffstat (limited to 'binding/radio_impl_tef665x.c')
-rw-r--r--binding/radio_impl_tef665x.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/binding/radio_impl_tef665x.c b/binding/radio_impl_tef665x.c
index eeac170..17454b8 100644
--- a/binding/radio_impl_tef665x.c
+++ b/binding/radio_impl_tef665x.c
@@ -2144,15 +2144,19 @@ static int tef665x_init()
{
char gst_pipeline_str[GST_PIPELINE_LEN];
int rc;
- int ret = i2c_init(I2C_DEV, _open, &file_desc);
current_am_frequency = known_am_band_plans[am_bandplan].min;
current_fm_frequency = known_fm_band_plans[fm_bandplan].min;
+ rc = i2c_init(I2C_DEV, _open, &file_desc);
+ if(rc < 0) {
+ AFB_NOTICE("tef665x not present");
+ return -1;
+ }
_debug("file_desc= ", file_desc);
- ret = appl_get_identification(file_desc);
- if(ret != 1){
+ rc = appl_get_identification(file_desc);
+ if(rc != 1){
AFB_ERROR("no tef665x!");
return -1;
}
@@ -2187,11 +2191,11 @@ static int tef665x_init()
}
// Start pipeline in paused state
- ret = gst_element_set_state(pipeline, GST_STATE_PAUSED);
- _debug("gst_element_set_state to pause (at the begining)", ret);
+ rc = gst_element_set_state(pipeline, GST_STATE_PAUSED);
+ _debug("gst_element_set_state to pause (at the begining)", rc);
- ret = gst_bus_add_watch(gst_element_get_bus(pipeline), (GstBusFunc) handle_message, NULL);
- _debug("gst_bus_add_watch ret", ret);
+ rc = gst_bus_add_watch(gst_element_get_bus(pipeline), (GstBusFunc) handle_message, NULL);
+ _debug("gst_bus_add_watch rc", rc);
present = true;
@@ -2200,7 +2204,7 @@ static int tef665x_init()
pthread_mutex_init (&RDS_Mutex, NULL);
tef665x_start();
- return 0;
+ return 0;
}
static void tef665x_set_frequency_callback(radio_freq_callback_t callback,