dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
loadabletest.c
Go to the documentation of this file.
1 #include <loadable_extension.h>
2 
3 static void entry();
4 
6 
7 #include <stddef.h>
8 #include <pios_thread.h>
9 #include <pios_modules.h>
10 
11 static volatile int i = 3333;
12 volatile int j;
13 
14 //void dumb_test_delay(int i) __attribute__((long_call));
15 void dumb_test_delay(int i);
16 void dumb_test_two(void (*fp)(void));
17 
18 void dumb_regtask(struct pios_thread *h);
19 
20 const char *const foo = "foobar";
21 /* const char *foo = "test"; doesn't work presently.
22  * GOT correctly ends up pointing to offset on copydata.
23  * But offset on copydata points to location requiring a relocation.
24  * analysis here:
25  * https://gist.github.com/mlyle/308393dbc7df3762a366d585d5306ceb
26  */
27 
28 static void loopy(void *unused) {
29  (void) unused;
30 
31  while (1) {
36  }
37 
38 }
39 
40 static void entry() {
41  j = i * 2;
42 
43  struct pios_thread *loadable_task_handle;
44 
45  loadable_task_handle = PIOS_Thread_Create(loopy, "module", PIOS_THREAD_STACK_SIZE_MIN, NULL, PIOS_THREAD_PRIO_NORMAL);
46  if (loadable_task_handle) {
47  dumb_regtask(loadable_task_handle);
48  }
49 }
void dumb_test_delay(int i)
static volatile int i
Definition: loadabletest.c:11
volatile int j
Definition: loadabletest.c:12
static void loopy(void *unused)
Definition: loadabletest.c:28
#define PIOS_THREAD_STACK_SIZE_MIN
Definition: pios_thread.h:55
void dumb_regtask(struct pios_thread *h)
struct pios_thread * PIOS_Thread_Create(void(*fp)(void *), const char *namep, size_t stack_bytes, void *argp, enum pios_thread_prio_e prio)
Definition: pios_thread.c:89
DECLARE_LOADABLE_EXTENSION(entry)
void PIOS_Thread_Sleep(uint32_t time_ms)
Definition: pios_thread.c:229
uint8_t unused[4]
Definition: bl_messages.h:70
void system_annunc_custom_string(const char *string)
Definition: systemmod.c:417
const char *const foo
Definition: loadabletest.c:20
void dumb_test_two(void(*fp)(void))
static void entry()
Definition: loadabletest.c:40