Source

inpulse / app.h

/** \file
 * Shared apps on the inPulse watch.
 *
 * Each app provides a set of entry functions.
 * Each app shares a common block that they can use for
 * scratch space or frame buffer.  A pointer to this space will
 * be passed to each of the callback functions.
 */
#ifndef _app_h_
#define _app_h_

#include <pulse_os.h>
#include <pulse_types.h>
#include <app_resources.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>


typedef struct app app_t;

struct app
{
	void (*init)(void);
	void (*loop)(struct pulse_time_tm * now);
	void (*button_down)(void);
	void (*button_up)(unsigned milliseconds);
#ifdef CONFIG_HAVE_HW_UPDATE
	void (*hardware_update)(enum PulseHardwareEvent event);
#endif
#ifdef CONFIG_HAVE_DOZ
	void (*doz)(void);
#endif
};


#define APP_COMMON_SIZE	1300
extern void * const app_common_data;

#endif