Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
flood.cpp@29:7246460b73f8, 2014-09-24 (annotated)
- Committer:
- klauss
- Date:
- Wed Sep 24 18:02:18 2014 +0000
- Revision:
- 29:7246460b73f8
- Parent:
- 21:0bd688722e81
- Child:
- 48:195c97f12e8e
- Mudancas no prompt; - Timer do cb off enquanto ele estiver em ligacao
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Cola | 21:0bd688722e81 | 1 | #include "mbed.h" |
Cola | 21:0bd688722e81 | 2 | #include "flood.h" |
Cola | 21:0bd688722e81 | 3 | #include "parallelcpld.h" |
Cola | 21:0bd688722e81 | 4 | |
Cola | 21:0bd688722e81 | 5 | uint8_t pflood = 0; |
Cola | 21:0bd688722e81 | 6 | |
Cola | 21:0bd688722e81 | 7 | Timer tflood; |
Cola | 21:0bd688722e81 | 8 | int floodcount = 0; |
Cola | 21:0bd688722e81 | 9 | |
klauss | 29:7246460b73f8 | 10 | void flood (){ |
klauss | 29:7246460b73f8 | 11 | if( tflood.read_us() > floodcount ){ |
klauss | 29:7246460b73f8 | 12 | while( tflood.read_us() > floodcount ){ |
klauss | 29:7246460b73f8 | 13 | floodcount += 20000; |
klauss | 29:7246460b73f8 | 14 | } |
klauss | 29:7246460b73f8 | 15 | uint8_t Bflood[300]; |
klauss | 29:7246460b73f8 | 16 | uint8_t j; |
klauss | 29:7246460b73f8 | 17 | static uint8_t flood_start =0; |
klauss | 29:7246460b73f8 | 18 | j = flood_start; |
klauss | 29:7246460b73f8 | 19 | for (int i = 0; i < 300; i++) { |
klauss | 29:7246460b73f8 | 20 | Bflood[i] = j++; |
klauss | 29:7246460b73f8 | 21 | } |
klauss | 29:7246460b73f8 | 22 | flood_start++; |
klauss | 29:7246460b73f8 | 23 | Bflood[6] = 0x40; |
klauss | 29:7246460b73f8 | 24 | xmemcpy(TXBuffer, Bflood, 300); |
Cola | 21:0bd688722e81 | 25 | |
klauss | 29:7246460b73f8 | 26 | send2callboxes(); |
klauss | 29:7246460b73f8 | 27 | pc.printf("F"); |
klauss | 29:7246460b73f8 | 28 | } |
Cola | 21:0bd688722e81 | 29 | } |