krnl
Macros | Typedefs | Functions | Variables
sm.c File Reference
#include <stdio.h>
Include dependency graph for sm.c:

Go to the source code of this file.

Macros

#define NEXT(x, y, z)   return ((void *)x)
 

Typedefs

typedef void *(* pF) (void)
 

Functions

voidled_on ()
 
voidled_off ()
 
voidled_save ()
 
int readSensors ()
 
void setMotors (int dir)
 
voidleft ()
 
voidcenter ()
 
voidright ()
 
voiddoInit ()
 
void setup ()
 
void loop ()
 

Variables

pF statefunc
 
pF oldfunc = NULL
 
int sensors
 

Macro Definition Documentation

◆ NEXT

#define NEXT (   x,
  y,
 
)    return ((void *)x)

Definition at line 7 of file sm.c.

Typedef Documentation

◆ pF

typedef void*(* pF) (void)

Definition at line 5 of file sm.c.

Function Documentation

◆ center()

void* center ( )

Definition at line 74 of file sm.c.

References left(), NEXT, readSensors(), right(), sensors, and setMotors().

Referenced by doInit(), left(), and right().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ doInit()

void* doInit ( )

Definition at line 115 of file sm.c.

References center(), left(), readSensors(), right(), and sensors.

Referenced by setup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ led_off()

void* led_off ( )

Definition at line 50 of file sm.c.

References led_off(), led_on(), led_save(), NEXT, and pause().

Referenced by jens(), led_off(), led_on(), and led_save().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ led_on()

void* led_on ( )

Definition at line 28 of file sm.c.

References led_off(), led_on(), and NEXT.

Referenced by jens(), led_off(), led_on(), led_save(), and pause().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ led_save()

void* led_save ( )

Definition at line 65 of file sm.c.

References jens(), led_off(), led_on(), led_save(), and NEXT.

Referenced by led_off(), and led_save().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ left()

void* left ( )

Definition at line 52 of file sm.c.

References center(), NEXT, readSensors(), right(), sensors, and setMotors().

Referenced by center(), doInit(), and right().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loop()

void loop ( )

Definition at line 133 of file sm.c.

References oldfunc, and statefunc.

◆ readSensors()

int readSensors ( )

Definition at line 33 of file sm.c.

Referenced by center(), doInit(), left(), and right().

Here is the caller graph for this function:

◆ right()

void* right ( )

Definition at line 95 of file sm.c.

References center(), left(), NEXT, readSensors(), sensors, and setMotors().

Referenced by center(), doInit(), and left().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMotors()

void setMotors ( int  dir)

Definition at line 42 of file sm.c.

Referenced by center(), left(), and right().

Here is the caller graph for this function:

◆ setup()

void setup ( )

Definition at line 130 of file sm.c.

References doInit(), and statefunc.

Here is the call graph for this function:

Variable Documentation

◆ oldfunc

pF oldfunc = NULL

Definition at line 23 of file sm.c.

◆ sensors

int sensors

Turn on leds

Returns
led_off next_state
Remarks
only to be called after start of ...

Definition at line 31 of file sm.c.

Referenced by center(), doInit(), left(), and right().

◆ statefunc

pF statefunc

Definition at line 23 of file sm.c.