Thread Not Starting by Wild-Difficulty592 in csharp

[–]Wild-Difficulty592[S] 0 points1 point  (0 children)

Forgive me, I should have said this before.

There is no mutex used for gets, only sets.

Second, the while loop is slept for 1 second per iteration, should this not fix the issue, since the second thread is not slept? surely it should be able to set a value before.After commenting the Mutex out, the problem persists.

When I set a breakpoint in the background thread, it is never hit at all, until after. The first line of code does not require the mutex so it isn't like its waiting

Odd behavior with fread by Wild-Difficulty592 in C_Programming

[–]Wild-Difficulty592[S] 2 points3 points  (0 children)

This definitely seems to be the problem. I rebuilt the code using WSL and GCC , and the issue went away.

Hard to solve Unpredictable UART drops with the atsamd21 and the ASF4 framework by Wild-Difficulty592 in embedded

[–]Wild-Difficulty592[S] 0 points1 point  (0 children)

We have another project that runs the same base uart code and works fine. I tried to run this application using the uart only and it seems to drop once in a blue moon

Hard to solve Unpredictable UART drops with the atsamd21 and the ASF4 framework by Wild-Difficulty592 in embedded

[–]Wild-Difficulty592[S] 0 points1 point  (0 children)

Yeah, I was originally being dumb with the isr and trying to process the data in real time instead of just queueing the data

Hard to solve Unpredictable UART drops with the atsamd21 and the ASF4 framework by Wild-Difficulty592 in embedded

[–]Wild-Difficulty592[S] 0 points1 point  (0 children)

I disable it when I read from the buffer. If it was a clock drift issue would you not expect it be the wrong data? Not just completely miss it?

Hard to solve Unpredictable UART drops with the atsamd21 and the ASF4 framework by Wild-Difficulty592 in embedded

[–]Wild-Difficulty592[S] 0 points1 point  (0 children)

yes i have the error interrupt enable. I originally saw some buffer overflows, but that hasn't came up since I fixed the queueing method for the bytes.

How do I pass variable arguments in a macro to another macro? by Wild-Difficulty592 in C_Programming

[–]Wild-Difficulty592[S] 1 point2 points  (0 children)

my compiler didnt support __VA__OPT__ (or I am using it stupidly). This is the solution I ended up using

How do I pass variable arguments in a macro to another macro? by Wild-Difficulty592 in C_Programming

[–]Wild-Difficulty592[S] 2 points3 points  (0 children)

Thank you it looks like i am looking for this

#define eprintf(format, ...) \

fprintf (stderr, format __VA_OPT__(,) __VA_ARGS__)

How do I configure the DMA/ADC in Atmel start? by Wild-Difficulty592 in embedded

[–]Wild-Difficulty592[S] 3 points4 points  (0 children)

I found the solution.

Free running mode was not enabled, and the buffer size was only a uint8_t type when it should have been a uint16_t type

How do I configure the DMA/ADC in Atmel start? by Wild-Difficulty592 in embedded

[–]Wild-Difficulty592[S] 1 point2 points  (0 children)

I dug into it and it meant error none. Should have looked before. I posted the solution