I'm writing a small threading manager for microcontrollers and having problems in referencing pointers to void :)
Type: Posts; User: wolfrose
I'm writing a small threading manager for microcontrollers and having problems in referencing pointers to void :)
Hi,
I want to get a pointer to a list of data that should be a list of arguments.
These are header stuff:
...
I liked the "toys" description :biggrin:
Yes of course without OS, one has to read the datasheet and write the device drivers for that chip.
Arduino; for example, is doing this by installing...
Yes, I got you, you mean that the hardware is something done which is the CPU and how it handles tasks, that's the hardware part.
But for the software part, it is the way how the core main...
OK, so my understanding for the desktop running concept is that windows is built over a kernel written in C.
So the kernel of the CPU is the one that do the algorithms, logic and arithmetic...
Hi,
I hope it's the right forum to ask this question, I was doing a simple microcontroller session and one asked me this question which I didn't expect actually ;)
He asked me why in a C...
So is recursion a good programming practice or I better use function pointers and callbacks from a manager function ?
It means like "hopefully" in the Arabic language, also; like, for sake of God, for the love of God ... etc. Arabs also have religious phrases like any other regions in the world :) I hope it's not a...
I found this link which talks about the goals I want to reach for God's will.
Arduino Linked List Menu for LCD | Arduino | C++ Programming | Freelancer
Yes, I want a code that manage the writes...
I checked the optimizations in codeblocks, there are 11. Which one to use ?
Also, went to the gcc website, this link, there are a lot of stuff here:
Optimize Options (Using the GNU Compiler...
OK, so unless I optimize the compiler, it would be like free machine. Basically a compiler like the GCC is doing anything freely without optimizations. The programmer has to do them.
Are there any...
It's ok, I'm not insisting on this method, II just tried it and thought why it crashes every time.
My alternative solution is to run a normal timer; like:
uint32_t millis(void){
...
I'm searching now for software timers.
I want a timer to run the background, I want to do some multitasking and learn a little bit of threading.
But the same method is known in C programming. Check this link:
C - Recursion - Tutorialspoint
Yes, I think the recursive calls are causing the problem. A normal while loop works perfectly.
Yes, the way I'm calling the function from itself is wrong I guess, I should call another problem.
Hello,
I'm trying to emulate Arduino
millis() function which is used for functions timing, ... etc.
I tried this function which is working until it hits 43178 and stops every time I run this...
It's OK I solved it partially.
Hello,
I have another question regarding accessing struct in multiple source files. Should I post it here or open a new thread ?
OK, I did little adjustments. I changed the function pointer to return a value, and this way I can use it with functions that return values and functions that returns void.
...
OK, sorry didn't notice the way of assigning the function pointer.
I tested the code, it's working but I tried something else.
What if the function is returning something ? how to design the...
OK, I tried that, and started with a function that returns 32-bit number.
But got an error:
static unsigned int i;
I'm trying to do this:
void (*function_pointer)(void *);
uint8_t fun1(uint8_t a, uint8_t b, uint8_t *str1){
printf("%s",*str1);
return a + b;
Thank you so much for clarifying this, didn't know this about stucts syntax, what about unions and enums, do they follow the same rules ?
Isn't there a way to declare a function pointer with a form that can receive any type of function ?
Because I have different types of functions; for example,
void fun1(uint8_t num, uint8_t...
Hi,
I have two main questions:
1. How to design a function pointer that can deal with various types of functions ?
For example, I have a function that receive 3 arguments. I tried to assign...