Skip to content
Snippets Groups Projects
Commit c3751263 authored by Adrian Schneider's avatar Adrian Schneider
Browse files

chore(ambient) make code style complient

parent f1343fc0
No related branches found
No related tags found
No related merge requests found
Pipeline #1321 passed
......@@ -5,7 +5,6 @@
#include "adc.h"
#include "gpio.h"
#define READ_FREQ 100
static uint16_t last_value;
......@@ -13,10 +12,12 @@ static TaskHandle_t poll_task;
void epic_ambient_init()
{
const sys_cfg_adc_t sys_adc_cfg = NULL; /* No system specific configuration needed. */
const sys_cfg_adc_t sys_adc_cfg =
NULL; /* No system specific configuration needed. */
if (ADC_Init(0x9, &sys_adc_cfg) != E_NO_ERROR) {
printf("Error Bad Parameter\n");
while (1);
while (1)
;
}
GPIO_Config(&gpio_cfg_adc7);
}
......@@ -25,8 +26,7 @@ void vReadAdcTask()
{
TickType_t last_wake_time;
last_wake_time = xTaskGetTickCount();
for (;;)
{
for (;;) {
vTaskDelayUntil(&last_wake_time, READ_FREQ);
ADC_StartConvert(ADC_CH_7, 0, 0);
......@@ -36,8 +36,7 @@ void vReadAdcTask()
void epic_ambient_run()
{
if (poll_task)
{
if (poll_task) {
// task is already running
return;
}
......@@ -51,18 +50,17 @@ void epic_ambient_run()
configMINIMAL_STACK_SIZE,
NULL,
1,
&poll_task);
&poll_task
);
if (xReturned == pdPASS)
{
if (xReturned == pdPASS) {
//TODO: Handle failure
}
}
void epic_ambient_stop()
{
if (!poll_task)
{
if (!poll_task) {
// task isn't running
return;
}
......
......@@ -30,7 +30,9 @@ STATIC const mp_rom_map_elem_t ambient_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_stop), MP_ROM_PTR(&ambient_stop_obj) },
{ MP_ROM_QSTR(MP_QSTR_get_reading), MP_ROM_PTR(&ambient_get_obj) }
};
STATIC MP_DEFINE_CONST_DICT(ambient_module_globals, ambient_module_globals_table);
STATIC MP_DEFINE_CONST_DICT(
ambient_module_globals, ambient_module_globals_table
);
const mp_obj_module_t ambient_module = {
.base = { &mp_type_module },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment