Skip to content

Commit

Permalink
Remove swtimer
Browse files Browse the repository at this point in the history
see #4
  • Loading branch information
Martin Lenders committed Apr 11, 2013
1 parent 95158bd commit 07e8ac9
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 470 deletions.
2 changes: 1 addition & 1 deletion core/include/hwtimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* interrupt context and must use the shortest possible execution time (e.g.
* set a flag and trigger a worker thread).
*
* <b>hwtimer must not be used within applications</b>, use \ref swtimer
* <b>hwtimer must not be used within applications</b>, use \ref vtimer
* instead.
*
* @defgroup hwtimer Hardware timer
Expand Down
3 changes: 0 additions & 3 deletions sys/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ endif
ifneq (,$(findstring shell_commands,$(USEMODULE)))
DIRS += shell/commands
endif
ifneq (,$(findstring swtimer,$(USEMODULE)))
DIRS += swtimer
endif
ifneq (,$(findstring timex,$(USEMODULE)))
DIRS += timex
endif
Expand Down
4 changes: 0 additions & 4 deletions sys/auto_init/auto_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ void auto_init(void) {
DEBUG("Auto init vtimer module.\n");
vtimer_init();
#endif
#ifdef MODULE_SWTIMER
DEBUG("Auto init swtimer module.\n");
swtimer_init();
#endif
#ifdef MODULE_UART0
DEBUG("Auto init uart0 module.\n");
board_uart0_init();
Expand Down
4 changes: 0 additions & 4 deletions sys/include/auto_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
#include <hwtimer.h>
#endif

#ifdef MODULE_SWTIMER
#include <swtimer.h>
#endif

#ifdef MODULE_SHT11
#include <sht11.h>
#endif
Expand Down
147 changes: 0 additions & 147 deletions sys/include/swtimer.h

This file was deleted.

12 changes: 7 additions & 5 deletions sys/ping/ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
#include "cc110x/cc1100.h"
#include "lpc2387.h"

#include "swtimer.h"
#include "vtimer.h"
#include "timex.h"
#include "gpioint.h"
#include <ping.h>

ping_payload *pipa;
protocol_t protocol_id = 0;
radio_address_t r_address = 0;
uint64_t start = 0;
timex_t start = 0;
float rtt = 0;

void ping_handler(void *payload, int payload_size,
Expand Down Expand Up @@ -48,7 +49,7 @@ void ping(radio_address_t addr, uint8_t channr){
cc1100_set_channel(channr);
cc1100_set_address(r_address);
while(1){
start = swtimer_now();
start = vtimer_now();
int trans_ok = cc1100_send_csmaca(addr,
protocol_id,2,pipa->payload,sizeof(pipa->payload));
if(trans_ok < 0)
Expand All @@ -58,9 +59,10 @@ void ping(radio_address_t addr, uint8_t channr){
}

void calc_rtt(void){
uint64_t end = swtimer_now();
timex_t end = vtimer_now();
timex_t result = vtimer_sub(end, start);

rtt = ((float)end - (float)start)/1000;
rtt = result.seconds+(float)result.microseconds/100000;
}

void print_success(void){
Expand Down
5 changes: 0 additions & 5 deletions sys/swtimer/Makefile

This file was deleted.

Loading

0 comments on commit 07e8ac9

Please sign in to comment.