Skip to content

Commit

Permalink
Added WTCHDG mode in documentation, updated state diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
Yarmek authored and Yarmek committed Aug 30, 2017
1 parent e4fa90f commit e25b28f
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 12 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,24 @@
A watchdog running [V-USB](http://www.obdev.at/vusb/) on an Attiny85 that identifies itself as a USB keyboard and sends keyboard strokes.

## What Can kbdwtchdg Do?
It sends a defined message via USB to the computer. It does that either after a specific period of time after being plugged in,
or after a capslock trigger (pressing capslock x times).

###WTCHDG Mode

In WTCHDG mode, kbdwtchdg listens for the capslock trigger to occur during WTCHDG_INTERVAL. If no trigger occurs, the text is written.
If a trigger occurs, the timer is reset.

###Non-WTCHDG Mode

After receiving the capslock trigger and waiting for DELAY time the text is written.

###Initial Writing

If first_start is set the text is written after INITIAL_DELAY after power up.

![state diagram](images/StateDiagram.png)

## How to Use
The repo contains an AtmelStudio 7 project file that is preconfigured for kbdwtchdg.
The repo contains an AtmelStudio 7 project file that is preconfigured for kbdwtchdg.

[Documentation can be found here.](http://kbdwtchdg.readthedocs.io)

Expand Down
24 changes: 18 additions & 6 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,26 @@ A watchdog running `V-USB <http://www.obdev.at/vusb/>`_ on an Attiny85 that iden
What Can kbdwtchdg Do?
----------------------

It sends a defined message via USB to the computer. It does that either after a specific period of time after being plugged in,
or after a capslock trigger (pressing capslock x times).
WTCHDG Mode
^^^^^^^^^^^

In WTCHDG mode, kbdwtchdg listens for the capslock trigger to occur during WTCHDG_INTERVAL. If no trigger occurs, the text is written.
If a trigger occurs, the timer is reset.

Non-WTCHDG Mode
^^^^^^^^^^^^^^^

After receiving the capslock trigger and waiting for DELAY time the text is written.

Initial Writing
^^^^^^^^^^^^^^^

If first_start is set the text is written after INITIAL_DELAY after power up.

.. image:: ../images/StateDiagram.png
:scale: 100%
:align: center

How to Use
----------

Expand All @@ -24,9 +37,9 @@ The repo contains an AtmelStudio 7 project file that is preconfigured for kbdwtc
Acknowledgements
----------------

The code of this project is based on `Frank Zhao's USB business card <http://www.instructables.com/id/USB-PCB-Business-Card/>`_ and
The code of this project is based on `Frank Zhao's USB business card <http://www.instructables.com/id/USB-PCB-Business-Card/>`_ and
built based on Dovydas R.'s circuit diagram for `usb_pass_input_with_buttons <https://github.com/Dovydas-R/usb_pass_input_with_buttons>`_.

This documentation was built using `antiweb <http://antiweb.readthedocs.io>`_

.. toctree::
Expand All @@ -37,4 +50,3 @@ This documentation was built using `antiweb <http://antiweb.readthedocs.io>`_
main
antiweb
changelog

Binary file modified images/StateDiagram.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions images/StateDiagram.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
@startuml
[*] -down-> init_delay: power
[*] -down-> init_delay: first_start == 1
[*] -right-> monitoring: first_start == 0\nWTCHDG == 1
[*] -left-> idle: first_start == 0\nWTCHDG == 0
init_delay: yellow LED, optional state
init_delay -down-> writing: INITIAL_DELAY
init_delay -down-> writing: wait INITIAL_DELAY
writing: red LED, reset timer
writing -left-> idle: WTCHDG == 0
writing -right-> monitoring: WTCHDG == 1
Expand All @@ -11,5 +13,5 @@ monitoring -left-> writing: No capslock trigger\n in WTCHDG_INTERVAL
idle: green LED
idle -> delay: capslock trigger
delay: yellow LED
delay -> writing: DELAY
delay -> writing: wait DELAY
@enduml

0 comments on commit e25b28f

Please sign in to comment.