Merge branch 'master' of ssh://ukleos.org/home/git/ukleos

This commit is contained in:
Kaspar Schleiser 2010-11-01 17:46:34 +01:00
commit 72c4b41561
4 changed files with 22 additions and 13 deletions

View File

@ -51,7 +51,6 @@ and the mailinglist (subscription via web site)
#include <time.h> #include <time.h>
#include <sys/time.h> #include <sys/time.h>
#include "lpc2387.h" #include "lpc2387.h"
#include "clock.h"
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
/** /**

View File

@ -45,7 +45,6 @@ and the mailinglist (subscription via web site)
#include "lpc2387.h" #include "lpc2387.h"
#include "lpc2387-rtc.h" #include "lpc2387-rtc.h"
#include "lpm.h" #include "lpm.h"
#include "clock.h"
#define PREINT_RTC 0x000001C8 /* Prescaler value, integer portion, PCLK = 15Mhz */ #define PREINT_RTC 0x000001C8 /* Prescaler value, integer portion, PCLK = 15Mhz */
#define PREFRAC_RTC 0x000061C0 /* Prescaler value, fraction portion, PCLK = 15Mhz */ #define PREFRAC_RTC 0x000061C0 /* Prescaler value, fraction portion, PCLK = 15Mhz */
@ -58,7 +57,6 @@ and the mailinglist (subscription via web site)
#define PRINTF(fmt, args...) #define PRINTF(fmt, args...)
#endif #endif
extern void _clock_alarm(void);
/** /**
* @brief epoch time in hour granularity * @brief epoch time in hour granularity
@ -155,7 +153,6 @@ void RTC_IRQHandler (void)
RTC_AMR = 0xff; // disable alarm irq RTC_AMR = 0xff; // disable alarm irq
PRINTF("alarm"); PRINTF("alarm");
lpm_end_awake(); lpm_end_awake();
_clock_alarm();
} }
VICVectAddr = 0; // Acknowledge Interrupt VICVectAddr = 0; // Acknowledge Interrupt

View File

@ -58,14 +58,13 @@ and the mailinglist (subscription via web site)
/* set measurement timeout to 1 second */ /* set measurement timeout to 1 second */
#define SHT11_MEASURE_TIMEOUT (1000) #define SHT11_MEASURE_TIMEOUT (1000)
/** sht11 measureable data */ /**
* @brief sht11 measureable data
*/
typedef struct { typedef struct {
/* temperature value */ float temperature; /**< temperature value */
float temperature; float relhum; /**< linear relative humidity */
/* linear relative humidity */ float relhum_temp; /**< temperature compensated relative humidity */
float relhum;
/* temperature compensated relative humidity */
float relhum_temp;
} sht11_val_t; } sht11_val_t;
/** /**
@ -84,9 +83,14 @@ void sht11_init(void);
/** /**
* @brief Read sensor * @brief Read sensor
* *
* @param value The struct to be filled with measured values
* @param mode Specifies type of data to be read
*
* @return 1 on success, 0 otherwise
*
* Example: * Example:
* \code struct sht11_val sht11; * \code sht11_val sht11;
* sht11_Read_Sensor(&sht11, HUMIDITY|TEMPERATURE); * sht11_read_sensor(&sht11, HUMIDITY|TEMPERATURE);
* printf("%-6.2f °C %5.2f %% %5.2f %%\n", sht11.temperature, sht11.relhum, sht11.relhum_temp); \endcode * printf("%-6.2f °C %5.2f %% %5.2f %%\n", sht11.temperature, sht11.relhum, sht11.relhum_temp); \endcode
*/ */
uint8_t sht11_read_sensor(sht11_val_t *value, sht11_mode_t mode); uint8_t sht11_read_sensor(sht11_val_t *value, sht11_mode_t mode);

View File

@ -64,14 +64,23 @@ typedef struct swtimer_t {
} action; } action;
} swtimer_t; } swtimer_t;
/**
* @brief Current system time
* @return Time in ticks since system boot
*/
swtime_t swtimer_now(); swtime_t swtimer_now();
/**
* @brief Initializes swtimer
* @return always 0
*/
int swtimer_init(); int swtimer_init();
/** /**
* @brief set swtimer interval and activate * @brief set swtimer interval and activate
* @param[in] t pointer to preinitialised swtimer_t * @param[in] t pointer to preinitialised swtimer_t
* @param[in] interval swtimer interval * @param[in] interval swtimer interval
* @return always 0
*/ */
int swtimer_set(swtimer_t *t, swtime_t interval); int swtimer_set(swtimer_t *t, swtime_t interval);