Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/ldma_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#include "cmsis_os2.h"

typedef struct {
int channel;
uint32_t channel;
osThreadId_t thrd;
int name;
int signal;
uint32_t name;
uint32_t signal;
struct ldma_handler_conf_t* next;
} ldma_handler_conf_t;

Expand Down
8 changes: 5 additions & 3 deletions silabs/ldma_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Copy link
Copy Markdown
Contributor

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" };



void LDMA_IRQHandler (void)
{
Expand All @@ -21,17 +22,18 @@ void LDMA_IRQHandler (void)
//err1("ldma if");
}

LDMA_IntClear(pending);


ldma_handler_conf_t* ptr = &m_head;
while(ptr != NULL)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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) )
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BARR - remove spaces if ((pending & (1 << ptr->channel)))

{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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)
Expand Down
4 changes: 2 additions & 2 deletions silabs/logger_ldma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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);
Expand Down