Anti-Sway Capstone 1.0
Loading...
Searching...
No Matches
idle.c File Reference

Idle Mode Implementation. More...

#include <stdbool.h>
#include <pthread.h>
#include <stdint.h>
#include <stdlib.h>
#include "T1.h"
#include "setup.h"
#include "io.h"
#include "thread-lib.h"
#include "discrete-lib.h"
#include "idle.h"
Include dependency graph for idle.c:

Macros

#define DECIMAL_PRECISION   "3"
 
#define RAD_2_DEG(value)   value * 180.0 / PI
 

Functions

static void * IdleModeThread (void *resource)
 Idle Mode Thread Function.
 
int IdleFork ()
 
int IdleJoin ()
 

Variables

pthread_t idle_thread
 Thread ID.
 
ThreadResource resource
 Thread Resources (Shared Resources)
 
static int error
 Local Error Code.
 

Detailed Description

Idle Mode Implementation.

Author
Anti-Sway Team: Nguyen, Tri; Espinola, Malachi; Tevy, Vattanary; Hokenstad, Ethan; Neff, Callen)
Version
0.1
Date
2024-06-03

Function Documentation

◆ IdleFork()

int IdleFork ( )

Executes Idle Mode (concurrently), so we see how badly we messed up our code/sensors

Postcondition
If its already running, does nothing
Returns
0 upon success, negative if error
Here is the call graph for this function:

◆ IdleJoin()

int IdleJoin ( )

Stops Idle Mode (concurrent process) and our pain

Returns
0 upon success, negative if error

◆ IdleModeThread()

static void * IdleModeThread ( void * resource)
static

Idle Mode Thread Function.

The Thread Function for Idle Mode

Parameters
resourceA pointer to a Resource sturcture for Idle Mode
Returns
NULL

How many decimal places to include

Radians to Degrees Conversion Factor

Here is the call graph for this function: