[Example Plugin] Updated the example plugin

- It's now linking with libc/libutils/libdynamiclibs
- moved the main.c into the a "src" folder

[Loader]- Added DCFlushRange and DCInvalidateRange
- Improved logging.

Finally we can load the plugin from the sdcard and call it's function!
This commit is contained in:
Maschell
2018-02-09 21:31:05 +01:00
parent 4ce98a64f1
commit 10c5eccd93
6 changed files with 68 additions and 47 deletions

31
example_plugin/src/main.c Normal file
View File

@@ -0,0 +1,31 @@
#include <wups.h>
#include <malloc.h>
#include <string.h>
#include "dynamic_libs/os_functions.h"
#include "dynamic_libs/socket_functions.h"
#include "utils/logger.h"
WUPS_MODULE_NAME("test module");
WUPS_MODULE_VERSION("v1.0");
WUPS_MODULE_AUTHOR("Maschell");
WUPS_MODULE_LICENSE("BSD");
int func(void);
static int my_func2(void)
{
InitOSFunctionPointers();
InitSocketFunctionPointers();
log_init();
//log_printf is not working.
log_print("Logging from custom function.\n");
return 43;
}
WUPS_MUST_REPLACE(func,WUPS_LOADER_LIBRARY_GX2, my_func2);