SmartWheels self-driving race car. Designed for NXP Cup. Uses FRDM-KL25Z, area-scan camera, and simple image processing to detect and navigate any NXP spec track.

Dependencies:   TSI USBDevice mbed-dev

Fork of SmartWheels by haofan Zheng

Committer:
Bobymicjohn
Date:
Wed Apr 19 21:17:40 2017 +0000
Revision:
97:0ed9ede9a995
Parent:
86:51048c1f132f
Added Testing State.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hazheng 86:51048c1f132f 1 /**
hazheng 86:51048c1f132f 2 * @file TestingState.h
hazheng 86:51048c1f132f 3 * @brief The header file for the TestingState class.
hazheng 86:51048c1f132f 4 * @author Jordan Brack <jabrack@mix.wvu.edu>, Haofan Zheng <hazheng@mix.wvu.edu>
hazheng 86:51048c1f132f 5 *
hazheng 86:51048c1f132f 6 */
hazheng 82:992ba6f31e24 7 #pragma once
hazheng 82:992ba6f31e24 8 #ifndef TESTING_STATE_H
hazheng 82:992ba6f31e24 9 #define TESTING_STATE_H
hazheng 82:992ba6f31e24 10
hazheng 82:992ba6f31e24 11 #include <mbed.h>
hazheng 82:992ba6f31e24 12 #include "States.h"
hazheng 82:992ba6f31e24 13
hazheng 86:51048c1f132f 14 /**
hazheng 86:51048c1f132f 15 * @class TestingState
hazheng 86:51048c1f132f 16 * @brief The class for testing state. It is a child class of the States class.
hazheng 86:51048c1f132f 17 *
hazheng 86:51048c1f132f 18 */
hazheng 82:992ba6f31e24 19 class TestingState : public States
hazheng 82:992ba6f31e24 20 {
hazheng 82:992ba6f31e24 21 public:
hazheng 86:51048c1f132f 22 /**
hazheng 86:51048c1f132f 23 * @brief This is the constructor for the TestingState class
hazheng 86:51048c1f132f 24 */
hazheng 82:992ba6f31e24 25 TestingState();
hazheng 86:51048c1f132f 26 /**
hazheng 86:51048c1f132f 27 * @brief This is the destructor for the TestingState class
hazheng 86:51048c1f132f 28 */
hazheng 82:992ba6f31e24 29 ~TestingState();
hazheng 82:992ba6f31e24 30
hazheng 86:51048c1f132f 31 /**
hazheng 86:51048c1f132f 32 * @brief Draw the user interface. This function is called only once, whenever the testing state becomes the current state.
hazheng 86:51048c1f132f 33 */
hazheng 82:992ba6f31e24 34 virtual void DrawUserInterface();
hazheng 82:992ba6f31e24 35
hazheng 86:51048c1f132f 36 /**
hazheng 86:51048c1f132f 37 * @brief This functino will be called during every tick, only if the testing state is the current state.
hazheng 86:51048c1f132f 38 * @param deltaTime The time interval between last tick and current tick.
hazheng 86:51048c1f132f 39 */
hazheng 82:992ba6f31e24 40 virtual void Update(float deltaTime);
hazheng 82:992ba6f31e24 41
hazheng 86:51048c1f132f 42 /**
hazheng 86:51048c1f132f 43 * @brief Return wether or not the testing state has a position callback function for the touch screen.
hazheng 86:51048c1f132f 44 * @return 0 for not, 1 for yes.
hazheng 86:51048c1f132f 45 */
hazheng 82:992ba6f31e24 46 virtual uint8_t HasTouchPosFunction() const;
hazheng 82:992ba6f31e24 47
hazheng 86:51048c1f132f 48 /**
hazheng 86:51048c1f132f 49 * @brief Return wether or not the testing state has a interrupt callback function for the touch screen.
hazheng 86:51048c1f132f 50 * @return 0 for not, 1 for yes.
hazheng 86:51048c1f132f 51 */
hazheng 82:992ba6f31e24 52 virtual uint8_t HasTouchIrqFunction() const;
hazheng 82:992ba6f31e24 53
hazheng 86:51048c1f132f 54 /**
hazheng 86:51048c1f132f 55 * @brief The interrupt callback function for the touch screen.
hazheng 86:51048c1f132f 56 */
hazheng 82:992ba6f31e24 57 virtual void TouchIrqCallback();
Bobymicjohn 97:0ed9ede9a995 58
Bobymicjohn 97:0ed9ede9a995 59 private:
Bobymicjohn 97:0ed9ede9a995 60 volatile uint8_t m_shouldTerminate; /*!< @brief Did testing state received a pendding Terminating command? */
hazheng 82:992ba6f31e24 61 };
hazheng 82:992ba6f31e24 62
hazheng 82:992ba6f31e24 63 #endif //TESTING_STATE_H