Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adrian
firmware
Commits
c3751263
Commit
c3751263
authored
5 years ago
by
Adrian Schneider
Browse files
Options
Downloads
Patches
Plain Diff
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 years ago
Stage: build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
epicardium/modules/ambient.c
+39
-41
39 additions, 41 deletions
epicardium/modules/ambient.c
pycardium/modules/ambient.c
+15
-13
15 additions, 13 deletions
pycardium/modules/ambient.c
with
54 additions
and
54 deletions
epicardium/modules/ambient.c
+
39
−
41
View file @
c3751263
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
pycardium/modules/ambient.c
+
15
−
13
View file @
c3751263
...
...
@@ -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
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment