![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
flood.cpp@135:2f4290590e51, 2015-09-10 (annotated)
- Committer:
- klauss
- Date:
- Thu Sep 10 20:11:35 2015 +0000
- Revision:
- 135:2f4290590e51
- Parent:
- 125:8ff4dc96ad58
inclus?o das funcionalidades; - [get|set]_cbx_wake_mode; - [get|set]_cbx_detach_mode; - [get|set]_cbx_mode; - simula < ext > <msg_id > < type >; - refresh_status
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Cola | 21:0bd688722e81 | 1 | #include "flood.h" |
Cola | 21:0bd688722e81 | 2 | |
klauss | 135:2f4290590e51 | 3 | bool pflood = false; |
Cola | 21:0bd688722e81 | 4 | |
Cola | 21:0bd688722e81 | 5 | Timer tflood; |
Cola | 21:0bd688722e81 | 6 | int floodcount = 0; |
Cola | 21:0bd688722e81 | 7 | |
klauss | 29:7246460b73f8 | 8 | void flood (){ |
klauss | 29:7246460b73f8 | 9 | if( tflood.read_us() > floodcount ){ |
klauss | 29:7246460b73f8 | 10 | while( tflood.read_us() > floodcount ){ |
klauss | 29:7246460b73f8 | 11 | floodcount += 20000; |
klauss | 29:7246460b73f8 | 12 | } |
klauss | 29:7246460b73f8 | 13 | uint8_t Bflood[300]; |
klauss | 29:7246460b73f8 | 14 | uint8_t j; |
klauss | 119:ee6a53069455 | 15 | static uint8_t flood_start = 0; |
klauss | 29:7246460b73f8 | 16 | j = flood_start; |
klauss | 119:ee6a53069455 | 17 | for (int i = 0; i < 300; i++ ) |
klauss | 119:ee6a53069455 | 18 | { |
klauss | 29:7246460b73f8 | 19 | Bflood[i] = j++; |
klauss | 29:7246460b73f8 | 20 | } |
klauss | 119:ee6a53069455 | 21 | |
klauss | 29:7246460b73f8 | 22 | flood_start++; |
klauss | 119:ee6a53069455 | 23 | |
klauss | 125:8ff4dc96ad58 | 24 | Bflood[ TYPE_PLACE ] = FLOOD; |
klauss | 119:ee6a53069455 | 25 | Bflood[ CB_BUFFER_SIZE - 4 ] = 0x5a; |
klauss | 119:ee6a53069455 | 26 | Bflood[ CB_BUFFER_SIZE - 3 ] = 0x56; |
klauss | 119:ee6a53069455 | 27 | Bflood[ CB_BUFFER_SIZE - 2 ] = 0x5a; |
klauss | 119:ee6a53069455 | 28 | Bflood[ CB_BUFFER_SIZE - 1 ] = 0xe1; |
Cola | 21:0bd688722e81 | 29 | |
klauss | 74:81c47fff88a5 | 30 | send2callboxes( Bflood ); |
klauss | 135:2f4290590e51 | 31 | if( debug_uart3 and enable_flood ) pc.printf("F"); |
klauss | 135:2f4290590e51 | 32 | if( tcp_session and enable_flood ){ |
klauss | 48:195c97f12e8e | 33 | tcp_client.send_all( "F", strlen( "F" ) ); |
klauss | 48:195c97f12e8e | 34 | } |
klauss | 29:7246460b73f8 | 35 | } |
Cola | 21:0bd688722e81 | 36 | } |