Is it possible to pass variable type as part of a function parameter, e.g.:
void foo(varType type) { // Cast to global static unsigned char bar; bar =
You can't do that for a function, because then it needs to know the types of the arguments (and any other symbols the function uses) to generate working machine code. You could try a macro like:
#define foo(type_t) ({ \ unsigned char bar; \ bar = ((type_t*)(&static_array))->member; \ ... \ })