]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blobdiff - rpp/src/rpp/adc.c
Make the RPP layer thread safe
[pes-rpp/rpp-lib.git] / rpp / src / rpp / adc.c
index 30e180d7294ee2de45ffffb7096a58fed099789c..911b6e1244dbf962fcd7af3042d67d5db3f0cbb2 100644 (file)
@@ -33,6 +33,7 @@ int8_t rpp_adc_init()
 {
        if (initialized)
                return FAILURE;
+
        initialized = TRUE;
 
 #ifndef FREERTOS_POSIX
@@ -64,6 +65,9 @@ int8_t rpp_adc_update()
 {
 #ifndef FREERTOS_POSIX
        const struct port_desc *port = &port_desc[PORT_ID_ADC];
+
+       /* Thread safety is ensured in port_adc_get() resp.
+        * drv_adc_generic_read() */
        port->get(port, in_cache, sizeof(in_cache));
 #endif