-
Notifications
You must be signed in to change notification settings - Fork 5
Univ ldma handler dev #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
41697a7
10a7079
61b1d25
d03c204
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,8 @@ | |
|
|
||
| #define SIZE_OF_ARRAY(arr) (sizeof(arr))/sizeof(arr[0]) | ||
|
|
||
| static volatile ldma_handler_conf_t m_head; | ||
| static volatile ldma_handler_conf_t m_head = {0xFF, NULL, 0, 0, NULL}; | ||
|
|
||
|
|
||
| void LDMA_IRQHandler (void) | ||
| { | ||
|
|
@@ -21,17 +22,18 @@ void LDMA_IRQHandler (void) | |
| //err1("ldma if"); | ||
| } | ||
|
|
||
| LDMA_IntClear(pending); | ||
|
|
||
|
|
||
| ldma_handler_conf_t* ptr = &m_head; | ||
| while(ptr != NULL) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BARR - add space |
||
| { | ||
| if ( pending & (1<<ptr->channel) ) | ||
| if ( pending & (1 << ptr->channel) ) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BARR - remove spaces if ((pending & (1 << ptr->channel))) |
||
| { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Identation - open all files in editor and convert tabs to spaces and check after that the indentation is correct |
||
| osThreadFlagsSet(ptr->thrd, ptr->signal); | ||
| } | ||
| ptr = ptr->next; | ||
| } | ||
| LDMA_IntClear(pending); | ||
| } | ||
|
|
||
| void append_to_ldma_stored_configuration(ldma_handler_conf_t * newconf) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -230,7 +230,7 @@ static void ldma_thread (void* argument) | |
|
|
||
| while (osOK != osMutexAcquire(m_log_mutex, osWaitForever)); | ||
|
|
||
| if (flags & LOGGER_THREAD_FLAG_LDMA_DONE || flags & LOGGER_THREAD_FLAG_NEW_DATA) | ||
| if (flags & LOGGER_THREAD_FLAG_LDMA_DONE ) | ||
| { | ||
|
|
||
| busy = false; | ||
|
|
@@ -273,7 +273,7 @@ int logger_ldma_init () | |
|
|
||
| m_ldma_handler_conf.channel = LOGGER_LDMA_CHANNEL; | ||
| m_ldma_handler_conf.signal = LOGGER_THREAD_FLAG_LDMA_DONE; | ||
| m_ldma_handler_conf.thrd = &m_ldma_thread; | ||
| m_ldma_handler_conf.thrd = m_ldma_thread; | ||
| m_ldma_handler_conf.name = 69; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use constants instead of mystical numbers. e.g. #define DEFAULT_CONF_NAME 69 |
||
| m_ldma_handler_conf.next = NULL; | ||
| append_to_ldma_stored_configuration(&m_ldma_handler_conf); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use structre members names to initialize them e.g. const osThreadAttr_t app_thread_attr = { .name = "app" };