1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #700 from LudwigOrtmann/sniper_700

kernel_init: config_load, native: config_load: set id/address to PID
This commit is contained in:
Ludwig Ortmann 2014-03-19 15:04:19 +01:00
commit f490a7065d
3 changed files with 32 additions and 1 deletions

View File

@ -17,15 +17,33 @@
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#include "config.h"
#ifdef MODULE_NATIVENET
#include "nativenet.h"
#include "nativenet_internal.h"
#endif
#define ENABLE_DEBUG (0)
#include "debug.h"
/**
* XXX: loading not implemented
*/
void config_load(void)
{
printf("XXX: config_load(): not implemented\n");
DEBUG("config_load()\n");
int pid = getpid();
sysconfig.id = pid;
#ifdef MODULE_NATIVENET
_native_net_addr = pid;
#endif
return;
}

View File

@ -32,10 +32,17 @@
#include "thread.h"
#include "hwtimer.h"
#define ENABLE_DEBUG (0)
#include "debug.h"
#ifdef MODULE_AUTO_INIT
#include <auto_init.h>
#endif
#ifdef MODULE_CONFIG
#include "config.h"
#endif
volatile int lpm_prevent_sleep = 0;
extern int main(void);
@ -81,6 +88,11 @@ void kernel_init(void)
printf("kernel_init(): error creating main task.\n");
}
#ifdef MODULE_CONFIG
DEBUG("kernel_init(): loading config\n");
config_load();
#endif
printf("kernel_init(): jumping into first task...\n");
cpu_switch_context_exit();

View File

@ -39,6 +39,7 @@ struct rx_buffer_s {
extern struct rx_buffer_s _nativenet_rx_buffer[RX_BUF_SIZE];
extern uint64_t _native_net_addr_long;
extern radio_address_t _native_net_addr;
void _nativenet_handle_packet(radio_packet_t *packet);
int8_t send_buf(radio_packet_t *packet);