diff --git a/CHANGELOG.md b/CHANGELOG.md index 723a849..9f85783 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.0.1 (2024-04-15) + +## Bug Fixes + +- fix timestamp bugs. + ## 1.0.0 (2023-03-15) ## Features diff --git a/doc/html/driver__ir__remote_8c_source.html b/doc/html/driver__ir__remote_8c_source.html index 88ae99c..f7cb4c2 100644 --- a/doc/html/driver__ir__remote_8c_source.html +++ b/doc/html/driver__ir__remote_8c_source.html @@ -132,8 +132,8 @@
99  {
100  int64_t diff;
101 
-
102  diff = (int64_t)((int64_t)handle->decode[i + 1].t.s -
-
103  (int64_t)handle->decode[i].t.s) * 1000000 +
+
102  diff = (int64_t)((int64_t)handle->decode[i + 1].t.s -
+
103  (int64_t)handle->decode[i].t.s) * 1000000 +
104  (int64_t)((int64_t)handle->decode[i + 1].t.us -
105  (int64_t)handle->decode[i].t.us); /* diff time */
106  handle->decode[i].diff_us = (uint32_t)diff; /* save the time diff */
@@ -199,8 +199,8 @@
171  {
172  int64_t diff;
173 
-
174  diff = (int64_t)((int64_t)handle->decode[i + 1].t.s -
-
175  (int64_t)handle->decode[i].t.s) * 1000000 +
+
174  diff = (int64_t)((int64_t)handle->decode[i + 1].t.s -
+
175  (int64_t)handle->decode[i].t.s) * 1000000 +
176  (int64_t)((int64_t)handle->decode[i + 1].t.us -
177  (int64_t)handle->decode[i].t.us); /* diff time */
178  handle->decode[i].diff_us = (uint32_t)diff; /* save the time diff */
@@ -490,7 +490,7 @@
472 
473  return 1; /* return error */
474  }
-
475  diff = (int64_t)(t.s - handle->last_time.s) * 1000000 +
+
475  diff = (int64_t)(t.s - handle->last_time.s) * 1000000 +
476  (int64_t)(t.us - handle->last_time.us) ; /* now - last time */
477  if (diff - (int64_t)200000L >= 0) /* if over 1s, force reset */
478  {
@@ -500,15 +500,15 @@
482  {
483  handle->decode_len = 0; /* reset the decode */
484  }
-
485  handle->decode[handle->decode_len].t.s = t.s; /* save s */
+
485  handle->decode[handle->decode_len].t.s = t.s; /* save s */
486  handle->decode[handle->decode_len].t.us = t.us; /* save us */
487  handle->decode_len++; /* length++ */
-
488  handle->last_time.s = t.s; /* save last time */
+
488  handle->last_time.s = t.s; /* save last time */
489  handle->last_time.us = t.us; /* save last time */
490  if (handle->decode_len >= 68) /* check the end length */
491  {
-
492  diff = (int64_t)((int64_t)handle->decode[2].t.s -
-
493  (int64_t)handle->decode[1].t.s) * 1000000 +
+
492  diff = (int64_t)((int64_t)handle->decode[2].t.s -
+
493  (int64_t)handle->decode[1].t.s) * 1000000 +
494  (int64_t)((int64_t)handle->decode[2].t.us -
495  (int64_t)handle->decode[1].t.us); /* diff time */
496  if (a_check_frame((uint16_t)diff, IR_REMOTE_CHECK_START_LOW) == 0) /* check the frame */
@@ -518,8 +518,8 @@
500  }
501  if (handle->decode_len == 4) /* check the end length */
502  {
-
503  diff = (int64_t)((int64_t)handle->decode[2].t.s -
-
504  (int64_t)handle->decode[1].t.s) * 1000000 +
+
503  diff = (int64_t)((int64_t)handle->decode[2].t.s -
+
504  (int64_t)handle->decode[1].t.s) * 1000000 +
505  (int64_t)((int64_t)handle->decode[2].t.us -
506  (int64_t)handle->decode[1].t.us); /* diff time */
507  if (a_check_frame((uint16_t)diff, IR_REMOTE_CHECK_REPEAT) == 0) /* check the frame */
@@ -570,7 +570,7 @@
562 
563  return 1; /* return error */
564  }
-
565  handle->last_time.s = t.s; /* save last time */
+
565  handle->last_time.s = t.s; /* save last time */
566  handle->last_time.us = t.us; /* save last time */
567  handle->last_code.address = 0x00; /* init address 0 */
568  handle->last_code.command = 0x00; /* init command 0 */
@@ -671,7 +671,7 @@
ir_remote_s::status
uint8_t status
Definition: driver_ir_remote.h:83
ir_remote_s::address
uint8_t address
Definition: driver_ir_remote.h:84
ir_remote_time_s
ir_remote time structure definition
Definition: driver_ir_remote.h:92
-
ir_remote_time_s::s
uint32_t s
Definition: driver_ir_remote.h:93
+
ir_remote_time_s::s
uint64_t s
Definition: driver_ir_remote.h:93
ir_remote_time_s::us
uint32_t us
Definition: driver_ir_remote.h:94
diff --git a/doc/html/driver__ir__remote_8h_source.html b/doc/html/driver__ir__remote_8h_source.html index 74fe497..ebf24c4 100644 --- a/doc/html/driver__ir__remote_8h_source.html +++ b/doc/html/driver__ir__remote_8h_source.html @@ -122,7 +122,7 @@
87 
91 typedef struct ir_remote_time_s
92 {
-
93  uint32_t s;
+
93  uint64_t s;
94  uint32_t us;
95 } ir_remote_time_t;
96 
@@ -224,7 +224,7 @@
ir_remote_s::status
uint8_t status
Definition: driver_ir_remote.h:83
ir_remote_s::address
uint8_t address
Definition: driver_ir_remote.h:84
ir_remote_time_s
ir_remote time structure definition
Definition: driver_ir_remote.h:92
-
ir_remote_time_s::s
uint32_t s
Definition: driver_ir_remote.h:93
+
ir_remote_time_s::s
uint64_t s
Definition: driver_ir_remote.h:93
ir_remote_time_s::us
uint32_t us
Definition: driver_ir_remote.h:94
diff --git a/doc/html/functions.html b/doc/html/functions.html index 549f70e..fb6bdab 100644 --- a/doc/html/functions.html +++ b/doc/html/functions.html @@ -134,7 +134,7 @@ : ir_remote_handle_s
  • s -: ir_remote_time_s +: ir_remote_time_s
  • status : ir_remote_s diff --git a/doc/html/functions_vars.html b/doc/html/functions_vars.html index e35677f..3edf59c 100644 --- a/doc/html/functions_vars.html +++ b/doc/html/functions_vars.html @@ -134,7 +134,7 @@ : ir_remote_handle_s
  • s -: ir_remote_time_s +: ir_remote_time_s
  • status : ir_remote_s diff --git a/doc/html/group__ir__remote__basic__driver.js b/doc/html/group__ir__remote__basic__driver.js index 63ced15..5736e77 100644 --- a/doc/html/group__ir__remote__basic__driver.js +++ b/doc/html/group__ir__remote__basic__driver.js @@ -6,7 +6,7 @@ var group__ir__remote__basic__driver = [ "status", "structir__remote__s.html#ade818037fd6c985038ff29656089758d", null ] ] ], [ "ir_remote_time_s", "structir__remote__time__s.html", [ - [ "s", "structir__remote__time__s.html#a2dee666f0c1fe072c549ff86b1d0a8ab", null ], + [ "s", "structir__remote__time__s.html#a963840de6724d0090ffb30f4b6e6f8fc", null ], [ "us", "structir__remote__time__s.html#aacd10328101739a1c5576f0fbb6fd8e7", null ] ] ], [ "ir_remote_decode_s", "structir__remote__decode__s.html", [ diff --git a/doc/html/navtreeindex0.js b/doc/html/navtreeindex0.js index 711329b..bf219f4 100644 --- a/doc/html/navtreeindex0.js +++ b/doc/html/navtreeindex0.js @@ -162,6 +162,6 @@ var NAVTREEINDEX0 = "structir__remote__s.html#ade818037fd6c985038ff29656089758d":[0,0,1,0,2], "structir__remote__s.html#af3f726014b044194def151079f1f2d89":[0,0,1,0,0], "structir__remote__time__s.html":[0,0,1,1], -"structir__remote__time__s.html#a2dee666f0c1fe072c549ff86b1d0a8ab":[0,0,1,1,0], +"structir__remote__time__s.html#a963840de6724d0090ffb30f4b6e6f8fc":[0,0,1,1,0], "structir__remote__time__s.html#aacd10328101739a1c5576f0fbb6fd8e7":[0,0,1,1,1] }; diff --git a/doc/html/search/all_7.js b/doc/html/search/all_7.js index c1f0fb4..d0f8f69 100644 --- a/doc/html/search/all_7.js +++ b/doc/html/search/all_7.js @@ -1,6 +1,6 @@ var searchData= [ - ['s_80',['s',['../structir__remote__time__s.html#a2dee666f0c1fe072c549ff86b1d0a8ab',1,'ir_remote_time_s']]], + ['s_80',['s',['../structir__remote__time__s.html#a963840de6724d0090ffb30f4b6e6f8fc',1,'ir_remote_time_s']]], ['status_81',['status',['../structir__remote__s.html#ade818037fd6c985038ff29656089758d',1,'ir_remote_s']]], ['supply_5fvoltage_5fmax_82',['SUPPLY_VOLTAGE_MAX',['../driver__ir__remote_8c.html#a68eba8b601afe11f1b871d944976c035',1,'driver_ir_remote.c']]], ['supply_5fvoltage_5fmax_5fv_83',['supply_voltage_max_v',['../structir__remote__info__s.html#a3d2b12bcac7a85ea8646bff9debe8660',1,'ir_remote_info_s']]], diff --git a/doc/html/search/variables_7.js b/doc/html/search/variables_7.js index ae205a5..394ea64 100644 --- a/doc/html/search/variables_7.js +++ b/doc/html/search/variables_7.js @@ -1,6 +1,6 @@ var searchData= [ - ['s_136',['s',['../structir__remote__time__s.html#a2dee666f0c1fe072c549ff86b1d0a8ab',1,'ir_remote_time_s']]], + ['s_136',['s',['../structir__remote__time__s.html#a963840de6724d0090ffb30f4b6e6f8fc',1,'ir_remote_time_s']]], ['status_137',['status',['../structir__remote__s.html#ade818037fd6c985038ff29656089758d',1,'ir_remote_s']]], ['supply_5fvoltage_5fmax_5fv_138',['supply_voltage_max_v',['../structir__remote__info__s.html#a3d2b12bcac7a85ea8646bff9debe8660',1,'ir_remote_info_s']]], ['supply_5fvoltage_5fmin_5fv_139',['supply_voltage_min_v',['../structir__remote__info__s.html#ad8bde6ddadaf43d951e62f3befb9d35a',1,'ir_remote_info_s']]] diff --git a/doc/html/structir__remote__time__s.html b/doc/html/structir__remote__time__s.html index 252427d..b6930dd 100644 --- a/doc/html/structir__remote__time__s.html +++ b/doc/html/structir__remote__time__s.html @@ -98,8 +98,8 @@ - - + +

    Data Fields

    uint32_t s
     
    uint64_t s
     
    uint32_t us
     
    @@ -108,14 +108,14 @@

    Definition at line 91 of file driver_ir_remote.h.

    Field Documentation

    - -

    ◆ s

    + +

    ◆ s

    - +
    uint32_t suint64_t s
    diff --git a/doc/html/structir__remote__time__s.js b/doc/html/structir__remote__time__s.js index 17f106a..767fe2f 100644 --- a/doc/html/structir__remote__time__s.js +++ b/doc/html/structir__remote__time__s.js @@ -1,5 +1,5 @@ var structir__remote__time__s = [ - [ "s", "structir__remote__time__s.html#a2dee666f0c1fe072c549ff86b1d0a8ab", null ], + [ "s", "structir__remote__time__s.html#a963840de6724d0090ffb30f4b6e6f8fc", null ], [ "us", "structir__remote__time__s.html#aacd10328101739a1c5576f0fbb6fd8e7", null ] ]; \ No newline at end of file diff --git a/project/stm32f407/driver/src/stm32f407_driver_ir_remote_interface.c b/project/stm32f407/driver/src/stm32f407_driver_ir_remote_interface.c index 7996b08..3b76cc4 100644 --- a/project/stm32f407/driver/src/stm32f407_driver_ir_remote_interface.c +++ b/project/stm32f407/driver/src/stm32f407_driver_ir_remote_interface.c @@ -43,7 +43,7 @@ /** * @brief timer var definition */ -static uint32_t gs_second = 0; /**< second */ +static uint64_t gs_second = 0; /**< second */ /** * @brief timer callback diff --git a/src/driver_ir_remote.h b/src/driver_ir_remote.h index f056ba6..ea85a6d 100644 --- a/src/driver_ir_remote.h +++ b/src/driver_ir_remote.h @@ -90,7 +90,7 @@ typedef struct ir_remote_s */ typedef struct ir_remote_time_s { - uint32_t s; /**< second */ + uint64_t s; /**< second */ uint32_t us; /**< microsecond */ } ir_remote_time_t;