Sinapse-Energia / MIFARE-US

2 stars 0 forks source link

To design & define the flow diagram of the main program #3

Open ralcaide opened 7 years ago

ralcaide commented 7 years ago

It is necessary to define the flow diagram of the firmware. The main should be based in the python program available in the code

To use StarUML program to do that: http://staruml.io/ Example: https://github.com/Sinapse-Energia/AP-Sinapse/wiki/Flow-diagrams

ralcaide commented 7 years ago

Old Main program here: https://github.com/Sinapse-Energia/MIFARE-FreeRTOS/tree/master/third-party-old

soporteHW commented 7 years ago

At date 27/07/2017

[13:00 -14:00] Reading information about StarUML application.

soporteHW commented 7 years ago

First version flow diagram. I know it's a very iregular flow diagram. Sorry I don't manage the tool well. Check and fix errors in order to review the flow diagram

mifare_flow_diagram_v0p1

soporteHW commented 7 years ago

New flow diagram version uploaded. mifare_flow_diagram_v0p2

Please check it!

sinapseenergia commented 7 years ago

Some comments :startup

  1. Inizialization periphericals and Setup Context (update and load persistent variables and setup initial values)

Proccess Main (Wait for IRQ and maintain status (like NTP time)

IRQ - RFID message implies (as consequence, different functions)

Read RFID (IRQ routine) If Ok Beep and update LCD Mount http frame Send to server Wait for response (unti ltimeout) Beeps and update LCD with results If NOK Beeps and update LCD

Note: consider a proper attention to the case of new IRQ before sending. Process starts again (with new lecture). Se have to consider always last reading

sinapseenergia commented 7 years ago

Recondider program flow with comments

ralcaide commented 7 years ago

The workflow does not explain very well how the program should work. The WF should display the iterations and the logic in global view in order to ease the understanding.

Some concrete remarks:

Please, see here some WFs more realistic https://github.com/Sinapse-Energia/AP-Sinapse/wiki/Flow-diagrams, these flows maybe could help you to understand how to do the WFs in a better way

@soporteHW, take into account the @sinapseenergia comments a my comments and upload a new version.

soporteHW commented 7 years ago

New WF version: mifare_flow_diagram_v0p3

ralcaide commented 7 years ago

Comments - To improve:

ralcaide commented 7 years ago

New file uploaded: https://github.com/Sinapse-Energia/MIFARE-US/commit/22b9f01e21da5f745c447a7c505c4aba5c99bcef

ralcaide commented 7 years ago

Now, WF is much better. Anyway, the if_else statements should be improved. Please take into account the following comments:

soporteHW commented 7 years ago

New file uploaded: https://github.com/Sinapse-Energia/MIFARE-US/commit/5625dabdb1949f8f00f59ceab346fa3cf4e61104

sinapseenergia commented 7 years ago

Important:

Initial all periphericals fucntion:

As ST reccomends, all not used GPIOS, have to be definet as OUTPUT and inizializated to LOW level. Low level Set have to be done in this function.

EMI/EMC ST Reccomendations uploaded for reference

en.CD00004479.pdf