[chronojump] Chronopic-firmware 20MHz has TRIGGER_ON and TRIGGER_OFF



commit 45808f90a7285ccbe3d5a68e8b456de9e3c1edce
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Mar 1 17:44:00 2017 +0100

    Chronopic-firmware 20MHz has TRIGGER_ON and TRIGGER_OFF

 .../chronopic-firmware-20MHz.c                     |   16 ++-
 .../chronopic-firmware-20MHz.hex                   |  136 ++++++++++----------
 2 files changed, 79 insertions(+), 73 deletions(-)
---
diff --git a/chronopic-firmware/chronopic-firmware-c/chronopic-firmware-20MHz.c 
b/chronopic-firmware/chronopic-firmware-c/chronopic-firmware-20MHz.c
index 4a036fd..083d056 100644
--- a/chronopic-firmware/chronopic-firmware-c/chronopic-firmware-20MHz.c
+++ b/chronopic-firmware/chronopic-firmware-c/chronopic-firmware-20MHz.c
@@ -33,6 +33,7 @@ History:
   2012-04-02 change the baud rate = 115200, set default function = encoder.
   2012-04-19 if PC send command 'J' for porti scanning, Chronopic will return 'J'
   2017-02.28 Xavier Padull├ęs and Xavi de Blas: added triggerIfPushed, removed option 0 stuff, cleaned code.
+  2017-03-01 trigger now has ON and OFF
 */
 
 //-- this PIC is going to be used:
@@ -56,7 +57,8 @@ unsigned char FSTATUS = 'E';  // Petition of status of the platform
 unsigned char RSTATUS = 'E';  // Response of the status frame
 
 //RCA push (RB4) will activate trigger and this will be sent to Chronojump
-unsigned char TRIGGER = 'T';  // Trigger (RCA has been pushed)
+unsigned char TRIGGER_ON = 'T';  // Trigger (RCA has been pushed)
+unsigned char TRIGGER_OFF = 't';  // Trigger (RCA has been released)
 unsigned char RB4Previous = 0; //previous RB4 (RCA) to see if there's a change
 
 //-- Initialization value of the TIMER0 to have TICKS with a duration of Nms
@@ -159,13 +161,15 @@ void update_led()
 
 void triggerIfPushed()
 {
-       if(RB4 == 1)
+       if(RB4 == 1 && RB4Previous == 0)
        {
-               if(RB4Previous == 0)
-               {
-                       sci_sendchar(TRIGGER);
-               }
+               sci_sendchar(TRIGGER_ON);
        }
+       else if(RB4 == 0 && RB4Previous == 1)
+       {
+               sci_sendchar(TRIGGER_OFF);
+       }
+
        if(RB4Previous != RB4)
        {
                update_led();
diff --git a/chronopic-firmware/chronopic-firmware-c/chronopic-firmware-20MHz.hex 
b/chronopic-firmware/chronopic-firmware-c/chronopic-firmware-20MHz.hex
index 24b1eed..ecbd16e 100644
--- a/chronopic-firmware/chronopic-firmware-c/chronopic-firmware-20MHz.hex
+++ b/chronopic-firmware/chronopic-firmware-c/chronopic-firmware-20MHz.hex
@@ -1,33 +1,33 @@
-:1000000000008A110A129A29F200030E8301F100FE
-:100010000A088A01F000040883120313D000831237
-:1000200003134D08013A031D6A2883120313AF011D
+:1000000000008A110A12A929F200030E8301F100EF
+:100010000A088A01F000040883120313D100831236
+:1000200003134E08013A031D6A2883120313AF011C
 :10003000831203130B1D1F2883120313AF0A8312AD
 :1000400003132F08013A031D3C28831203130B11DD
 :10005000ED308100831203130C1E2A288312031330
-:100060004F0883120313990083120313CF018A11DF
+:10006000500883120313990083120313D0018A11DD
 :100070000A1232218A110A1283120313AF0183126A
 :1000800003138B1C462883120313AF0A8312031336
 :100090002F08013A031D6A28831203138B10831261
 :1000A0000313AF0183120313061D59288312031390
 :1000B000AF0A831203132F08013A031D632883122A
-:1000C0000313CF0A6A288312031306196A288312BE
-:1000D0000313CF03831203135008840070088A00AF
+:1000C0000313D00A6A288312031306196A288312BD
+:1000D0000313D003831203135108840070088A00AD
 :1000E0008301710E8300F20E720E09008312031356
-:1000F0004D08013A031D8B28153083160313860023
+:1000F0004E08013A031D8B28153083160313860022
 :100100000030F120831203138614FF3081000C218C
 :10011000831203130B160730831603138100272164
 :10012000831203130B1183120313B30183120313FE
-:100130008F018E0183120313470883120313B40047
-:1001400083120313480883120313BA000130831289
-:100150000313BB00002183120313B8006F21831225
-:1001600003138B160B178B176400831203134D08B0
+:100130008F018E0183120313480883120313B40046
+:1001400083120313490883120313BA000130831288
+:100150000313BB00002183120313B8007E21831216
+:1001600003138B160B178B176400831203134E08AF
 :10017000013A031DB42883120313B0018312031341
 :100180008C1EC52883120313B00A83120313300890
 :10019000013A031DB428831203138B122121831209
-:1001A0000313BE00831203134E08831203133E068B
-:1001B000031DDE28831203134E088C2183120313C0
+:1001A0000313BE00831203134F08831203133E068A
+:1001B000031DDE28831203134F089B2183120313B0
 :1001C0008B16B42808000030F12083120313430873
-:1001D0008C218312031338088C21831203138B158F
+:1001D0009B218312031338089B21831203138B1571
 :1001E0000800013A031DF728831203130B10831232
 :1001F00003138B110800831203130B108B150800D7
 :1002000083120313061A08298312031340080B29CB
@@ -38,57 +38,59 @@
 :1002500083160313990024309800903083120313FF
 :100260009800080083120313AE0183120313061EC5
 :100270003C2983120313AE0A831203132E08013A9A
-:10028000031D4C290030831203134504031D4C2920
-:100290008312031344088C2183120313AE018312CB
-:1002A0000313061E562983120313AE0A8312031387
-:1002B0004508831203132E06031D6F2183120313B7
-:1002C000AE0183120313061E682983120313AE0ABC
-:1002D000831203132E0883120313C5000800831230
-:1002E0000313AC0183120313061E7929831203132F
-:1002F000AC0A831203132C08003003190130AD003F
-:100300002D0C03188629831203138610031C8B29D6
-:10031000831203138614080083120313AC008312A4
-:1003200003130C1E8F29831203132C08831203134B
-:10033000990008002E30FE000230FF0080308A1144
-:100340000A12AF228A110A1283120313A1007F0836
-:10035000A0003030A2000230A30083120313200853
-:10036000A4002108A500FF30A007031CA103240856
-:10037000250403192A2A04302207A400A501A50D8B
-:100380002308A5072408FE002508FF0080308A11F5
-:100390000A12AF228A110A1283120313A7007F08E0
-:1003A000A6002208FE002308FF0080308A110A12EE
-:1003B000AF228A110A1283120313A900A5007F0835
-:1003C000A800A40002302207A400A501A50D23085F
-:1003D000A5072408FE002508FF0080308A110A12B4
-:1003E000AF228A110A1283120313A500AB007F0803
-:1003F000A400AA00831203132608AA002708AB0052
-:10040000FF30A607031CA7032A082B040319232A7D
-:100410002808FE002908FF0080308A110A129C2259
-:100420008A110A1283120313AA002408840083137A
-:10043000251883172A088000A80A0319A90AA40A04
-:100440000319A50AFA29063083120313A207031819
-:10045000A30AAD298A110A12762808001234003442
-:10046000D03402343F34003401340034D134023407
-:100470004034003401340034D23402344134003486
-:1004800001340034D33402344234003401340034B3
-:10049000D43402344334003401340034D5340234CB
-:1004A0004434003401340034D6340234453400344A
-:1004B00001340034D734023446340034013400347B
-:1004C000D83402344734003401340034D93402348F
-:1004D0004834003401340034DA340234493400340E
-:1004E00001340034DB3402344A3400340134003443
-:1004F000DC3402344B34003401340034DD34023453
-:100500004C34003401340034DE3402344D340034D1
-:1005100001340034DF3402344E340034013400340A
-:10052000E03402344F34003401340034E134023416
-:100530005134003401340034003A0319A32A803ABC
-:100540000319AA2A00347E08840083137F188317B6
-:10055000000808007F088A007E0882000800003A30
-:100560000319B72A803A0319C12AFF0100347E0813
-:10057000840083137F1883170008FF00840A000893
-:1005800008008A110A12AA22FD00FE0FFF03FF0ACB
-:100590008A110A12AA22FC007D08FF007C080800CC
-:1005A00000340134583445344534543400343D3437
-:1005B00014340034013402340034003401344A3439
-:0405C00000340034CF
+:10028000031D4D290030831203134604031D4D291D
+:100290008312031344089B215B2983120313061A5C
+:1002A0005B29831203134608013A031D5B2983125D
+:1002B000031345089B2183120313AE01831203131A
+:1002C000061E652983120313AE0A83120313460820
+:1002D000831203132E06031D7E2183120313AE0126
+:1002E00083120313061E772983120313AE0A8312A7
+:1002F00003132E0883120313C6000800831203138E
+:10030000AC0183120313061E882983120313AC0A5F
+:10031000831203132C08003003190130AD002D0C9B
+:1003200003189529831203138610031C9A2983123C
+:1003300003138614080083120313AC008312031303
+:100340000C1E9E29831203132C0883120313990099
+:1003500008003D30FE000230FF0080308A110A1292
+:10036000C4228A110A1283120313A1007F08A0007D
+:100370003F30A2000230A300831203132008A40020
+:100380002108A500FF30A007031CA10324082504B1
+:100390000319392A04302207A400A501A50D23085A
+:1003A000A5072408FE002508FF0080308A110A12E4
+:1003B000C4228A110A1283120313A7007F08A60021
+:1003C0002208FE002308FF0080308A110A12C4228E
+:1003D0008A110A1283120313A900A5007F08A8003E
+:1003E000A40002302207A400A501A50D2308A5073B
+:1003F0002408FE002508FF0080308A110A12C4225A
+:100400008A110A1283120313A500AB007F08A4000F
+:10041000AA00831203132608AA002708AB00FF30A6
+:10042000A607031CA7032A082B040319322A28084D
+:10043000FE002908FF0080308A110A12B1228A11B9
+:100440000A1283120313AA002408840083132518B8
+:1004500083172A088000A80A0319A90AA40A031905
+:10046000A50A092A063083120313A2070318A30A58
+:10047000BC298A110A127628080013340034E534A6
+:1004800002343F34003401340034E6340234403462
+:10049000003401340034E734023441340034013490
+:1004A0000034E83402344234003401340034E93496
+:1004B00002344334003401340034EA340234443426
+:1004C000003401340034EB34023445340034013458
+:1004D0000034EC3402344634003401340034ED345A
+:1004E00002344734003401340034EE3402344834EA
+:1004F000003401340034EF34023449340034013420
+:100500000034F03402344A34003401340034F1341D
+:1005100002344B34003401340034F23402344C34AD
+:10052000003401340034F33402344D3400340134E7
+:100530000034F43402344E34003401340034F534E1
+:1005400002344F34003401340034F6340234503471
+:10055000003401340034F7340234523400340134AE
+:100560000034003A0319B82A803A0319BF2A00342C
+:100570007E08840083137F188317000808007F0813
+:100580008A007E0882000800003A0319CC2A803ACB
+:100590000319D62AFF0100347E08840083137F18D4
+:1005A00083170008FF00840A000808008A110A1255
+:1005B000BF22FD00FE0FFF03FF0A8A110A12BF22AD
+:1005C000FC007D08FF007C0808000034013458342A
+:1005D000453445345434743400343D3414340034D8
+:1005E000013402340034003401344A34003400341D
 :00000001FF


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]