Browse Source

TAU로 수정

main
gudae 2 months ago
parent
commit
9db995cbb1
  1. BIN
      DefaultBuild/app_cmd_parser.obj
  2. BIN
      DefaultBuild/app_owi_service.obj
  3. BIN
      DefaultBuild/app_result.obj
  4. BIN
      DefaultBuild/app_scheduler.obj
  5. BIN
      DefaultBuild/delay.obj
  6. BIN
      DefaultBuild/dipSwitch.obj
  7. BIN
      DefaultBuild/gatectrl.obj
  8. BIN
      DefaultBuild/i2c.obj
  9. BIN
      DefaultBuild/multical.abs
  10. 2
      DefaultBuild/multical.clnk
  11. 828
      DefaultBuild/multical.map
  12. 2973
      DefaultBuild/multical.mot
  13. BIN
      DefaultBuild/owi.obj
  14. BIN
      DefaultBuild/r_cg_cgc.obj
  15. BIN
      DefaultBuild/r_cg_cgc_user.obj
  16. BIN
      DefaultBuild/r_cg_port.obj
  17. BIN
      DefaultBuild/r_cg_port_user.obj
  18. BIN
      DefaultBuild/r_cg_serial.obj
  19. BIN
      DefaultBuild/r_cg_serial_user.obj
  20. BIN
      DefaultBuild/r_cg_timer.obj
  21. BIN
      DefaultBuild/r_cg_timer_user.obj
  22. BIN
      DefaultBuild/r_cg_wdt.obj
  23. BIN
      DefaultBuild/r_cg_wdt_user.obj
  24. BIN
      DefaultBuild/r_main.obj
  25. BIN
      DefaultBuild/r_systeminit.obj
  26. BIN
      DefaultBuild/uart.obj
  27. 18
      QualityReport(multical,DefaultBuild).txt
  28. 2
      app_owi_service.c
  29. 152
      multical.mtpj
  30. 62
      multical.rcpe
  31. 186
      multical.temp.mtud
  32. 324
      owi.c
  33. 2
      owi.h
  34. 2
      r_cg_cgc.c
  35. 9
      r_cg_cgc.h
  36. 24
      r_cg_cgc_user.c
  37. 2
      r_cg_macrodriver.h
  38. 7
      r_cg_port.c
  39. 2
      r_cg_port.h
  40. 2
      r_cg_port_user.c
  41. 2
      r_cg_serial.c
  42. 2
      r_cg_serial.h
  43. 2
      r_cg_serial_user.c
  44. 157
      r_cg_timer.c
  45. 1048
      r_cg_timer.h
  46. 133
      r_cg_timer_user.c
  47. 2
      r_cg_userdefine.h
  48. 2
      r_cg_wdt.c
  49. 2
      r_cg_wdt.h
  50. 2
      r_cg_wdt_user.c
  51. 116
      r_main.c
  52. 4
      r_systeminit.c
  53. 483
      tmp/app_owi_service.asm
  54. 75
      tmp/capture-r5-build.log
  55. 8
      tmp/capture-r5-stack-build.log
  56. 1727
      tmp/owi.asm
  57. 70
      tmp/r_cg_cgc_user.asm
  58. 161
      tmp/r_cg_timer_user.asm
  59. 4145
      tmp/r_main.asm

BIN
DefaultBuild/app_cmd_parser.obj

Binary file not shown.

BIN
DefaultBuild/app_owi_service.obj

Binary file not shown.

BIN
DefaultBuild/app_result.obj

Binary file not shown.

BIN
DefaultBuild/app_scheduler.obj

Binary file not shown.

BIN
DefaultBuild/delay.obj

Binary file not shown.

BIN
DefaultBuild/dipSwitch.obj

Binary file not shown.

BIN
DefaultBuild/gatectrl.obj

Binary file not shown.

BIN
DefaultBuild/i2c.obj

Binary file not shown.

BIN
DefaultBuild/multical.abs

Binary file not shown.

2
DefaultBuild/multical.clnk

@ -20,6 +20,8 @@
-Input=DefaultBuild\app_owi_service.obj
-Input=DefaultBuild\r_cg_wdt.obj
-Input=DefaultBuild\r_cg_wdt_user.obj
-Input=DefaultBuild\r_cg_timer.obj
-Input=DefaultBuild\r_cg_timer_user.obj
-SECURITY_ID=00000000000000000000
-DEVICE=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10PPJ.DVF
-DEBug

828
DefaultBuild/multical.map

File diff suppressed because it is too large

2973
DefaultBuild/multical.mot

File diff suppressed because it is too large

BIN
DefaultBuild/owi.obj

Binary file not shown.

BIN
DefaultBuild/r_cg_cgc.obj

Binary file not shown.

BIN
DefaultBuild/r_cg_cgc_user.obj

Binary file not shown.

BIN
DefaultBuild/r_cg_port.obj

Binary file not shown.

BIN
DefaultBuild/r_cg_port_user.obj

Binary file not shown.

BIN
DefaultBuild/r_cg_serial.obj

Binary file not shown.

BIN
DefaultBuild/r_cg_serial_user.obj

Binary file not shown.

BIN
DefaultBuild/r_cg_timer.obj

Binary file not shown.

BIN
DefaultBuild/r_cg_timer_user.obj

Binary file not shown.

BIN
DefaultBuild/r_cg_wdt.obj

Binary file not shown.

BIN
DefaultBuild/r_cg_wdt_user.obj

Binary file not shown.

BIN
DefaultBuild/r_main.obj

Binary file not shown.

BIN
DefaultBuild/r_systeminit.obj

Binary file not shown.

BIN
DefaultBuild/uart.obj

Binary file not shown.

18
QualityReport(multical,DefaultBuild).txt

@ -1,13 +1,13 @@
QualityReport
2026년 8월 10일 월요일 오후 3:06:37
2026년 9월 15일 화요일 오후 3:47:46
------ Start build(multical, DefaultBuild) ------
------ Build ended(Error:0, Warning:0)(multical, DefaultBuild) ------
--- SHA1 hash value of output files ---
C:\Users\temp\Desktop\measurement_fw - 복사본\DefaultBuild\multical.abs: 0e61e61b13d9bf6e29db540d3cd3a5987482268d
C:\Users\temp\Desktop\measurement_fw - 복사본\DefaultBuild\multical.mot: c5e104f56736460312eb50bf4562d12797638ac8
C:\Users\temp\Desktop\Amo\2ch_fw\DefaultBuild\multical.abs: d683a56a51ef6a294c757508715400e77ffb23c8
C:\Users\temp\Desktop\Amo\2ch_fw\DefaultBuild\multical.mot: b209156e6b3ba51352f684d4d8c1aaf1ad7d202f
--- System Information ---
@ -18,7 +18,7 @@ C:\Users\temp\Desktop\measurement_fw - 복사본\DefaultBuild\multical.mot: c5e1
*.NET Framework Version
Microsoft .NET Framework 4 [.NET 4.8 or later] (533325)
*WebView2 Version
151.0.4129.72
152.0.4191.66
--- Application Information ---
*Product Name
@ -35,13 +35,13 @@ C:\Users\temp\Desktop\measurement_fw - 복사본\DefaultBuild\multical.mot: c5e1
C:\Program Files (x86)\Renesas Electronics\CS+\CC
*Memory Usage
*Private Working Set
244 MB
219 MB
*Number of GDI Objects
2784
2836
*Number of USER Objects
1568
1780
*Opened Files
36 editors, 36 files, 208 KB
38 editors, 38 files, 236 KB
--- Build Tool Plug-in Information ---
RH850 Build tool CC-RH Plug-in
@ -177,7 +177,7 @@ Device Information Common Interface
DeviceInformation.dll
--- Main Project Information ---
C:\Users\temp\Desktop\measurement_fw - 복사본\multical.mtpj
C:\Users\temp\Desktop\Amo\2ch_fw\multical.mtpj
Microcontroller Information
*R5F10PPJ
*File Name: Version

2
app_owi_service.c

@ -130,7 +130,7 @@ app_owi_result_t app_owi_read_basic(uint8_t id, int length)
R_WDT_Restart();
/* ??? ??? ???? ?? ?? */
if (needs_retry_for_long_read(&io, length)) {
if (needs_retry_for_long_read(&io, length) && io.ok && !io.timeout) {
io.ok = 0u;
io.timeout = 1u;
io.timeout_byte_index = 0xFFFEu;

152
multical.mtpj

@ -154,6 +154,27 @@
<TreeImageGuid>03cad1e8-2eb3-4cde-a8a3-982423631122</TreeImageGuid>
<ParentItem>cd2e4292-1297-4c3b-8415-f027a507b349</ParentItem>
</Instance>
<Instance Guid="9a7db17e-5cda-466f-978d-8303b77df832">
<Name>r_cg_timer.c</Name>
<Type>File</Type>
<RelativePath>r_cg_timer.c</RelativePath>
<TreeImageGuid>941832c1-fc3b-4e1b-94e8-01ea17128b42</TreeImageGuid>
<ParentItem>cd2e4292-1297-4c3b-8415-f027a507b349</ParentItem>
</Instance>
<Instance Guid="242d7df2-3dc6-4f5f-8b8b-288411b62f84">
<Name>r_cg_timer_user.c</Name>
<Type>File</Type>
<RelativePath>r_cg_timer_user.c</RelativePath>
<TreeImageGuid>941832c1-fc3b-4e1b-94e8-01ea17128b42</TreeImageGuid>
<ParentItem>cd2e4292-1297-4c3b-8415-f027a507b349</ParentItem>
</Instance>
<Instance Guid="e7bdf87a-97a0-41f8-96d7-299175d81288">
<Name>r_cg_timer.h</Name>
<Type>File</Type>
<RelativePath>r_cg_timer.h</RelativePath>
<TreeImageGuid>03cad1e8-2eb3-4cde-a8a3-982423631122</TreeImageGuid>
<ParentItem>cd2e4292-1297-4c3b-8415-f027a507b349</ParentItem>
</Instance>
<Instance Guid="82861e3a-5f66-47ce-b5d0-07c183f03a69">
<Name>OWI</Name>
<Type>Category</Type>
@ -433,31 +454,35 @@
<SourceItemType8>CSource</SourceItemType8>
<SourceItemGuid9>fc2298e3-7084-48f1-82a2-73802f131ffc</SourceItemGuid9>
<SourceItemType9>CSource</SourceItemType9>
<SourceItemGuid10>0960f7c9-320b-4b2d-a81a-b478a71746d0</SourceItemGuid10>
<SourceItemGuid10>7b2523c3-c8a7-4d28-b202-63e4967826c9</SourceItemGuid10>
<SourceItemType10>CSource</SourceItemType10>
<SourceItemGuid11>a9cdf116-8cac-46ba-8657-b2800695938c</SourceItemGuid11>
<SourceItemGuid11>52d34f97-2327-4b3c-b1c5-585ce576d939</SourceItemGuid11>
<SourceItemType11>CSource</SourceItemType11>
<SourceItemGuid12>bc73e110-ae8d-4f27-9dac-e0c97daecd6b</SourceItemGuid12>
<SourceItemGuid12>0960f7c9-320b-4b2d-a81a-b478a71746d0</SourceItemGuid12>
<SourceItemType12>CSource</SourceItemType12>
<SourceItemGuid13>0ddbc036-0fd2-430d-b3c5-4eea25bba043</SourceItemGuid13>
<SourceItemGuid13>a9cdf116-8cac-46ba-8657-b2800695938c</SourceItemGuid13>
<SourceItemType13>CSource</SourceItemType13>
<SourceItemGuid14>b8660be6-a832-48ed-b793-0021d8b0eadb</SourceItemGuid14>
<SourceItemGuid14>bc73e110-ae8d-4f27-9dac-e0c97daecd6b</SourceItemGuid14>
<SourceItemType14>CSource</SourceItemType14>
<SourceItemGuid15>e000232c-04f7-4af8-946d-b2621666c76d</SourceItemGuid15>
<SourceItemGuid15>0ddbc036-0fd2-430d-b3c5-4eea25bba043</SourceItemGuid15>
<SourceItemType15>CSource</SourceItemType15>
<SourceItemGuid16>810f033a-ef5c-49ee-a998-4b61acf35f60</SourceItemGuid16>
<SourceItemGuid16>b8660be6-a832-48ed-b793-0021d8b0eadb</SourceItemGuid16>
<SourceItemType16>CSource</SourceItemType16>
<SourceItemGuid17>05b3a7f6-13fe-4cd9-8718-94fa300c412c</SourceItemGuid17>
<SourceItemGuid17>e000232c-04f7-4af8-946d-b2621666c76d</SourceItemGuid17>
<SourceItemType17>CSource</SourceItemType17>
<SourceItemGuid18>3ec4bd88-055b-45d8-a20b-523e530c6a87</SourceItemGuid18>
<SourceItemGuid18>810f033a-ef5c-49ee-a998-4b61acf35f60</SourceItemGuid18>
<SourceItemType18>CSource</SourceItemType18>
<SourceItemGuid19>b7caf418-449c-4afa-9d64-16f7aef4371a</SourceItemGuid19>
<SourceItemGuid19>05b3a7f6-13fe-4cd9-8718-94fa300c412c</SourceItemGuid19>
<SourceItemType19>CSource</SourceItemType19>
<SourceItemGuid20>7b2523c3-c8a7-4d28-b202-63e4967826c9</SourceItemGuid20>
<SourceItemGuid20>3ec4bd88-055b-45d8-a20b-523e530c6a87</SourceItemGuid20>
<SourceItemType20>CSource</SourceItemType20>
<SourceItemGuid21>52d34f97-2327-4b3c-b1c5-585ce576d939</SourceItemGuid21>
<SourceItemGuid21>b7caf418-449c-4afa-9d64-16f7aef4371a</SourceItemGuid21>
<SourceItemType21>CSource</SourceItemType21>
<SourceItemCount>22</SourceItemCount>
<SourceItemGuid22>9a7db17e-5cda-466f-978d-8303b77df832</SourceItemGuid22>
<SourceItemType22>CSource</SourceItemType22>
<SourceItemGuid23>242d7df2-3dc6-4f5f-8b8b-288411b62f84</SourceItemGuid23>
<SourceItemType23>CSource</SourceItemType23>
<SourceItemCount>24</SourceItemCount>
<LastDeviceChangedCounter>0</LastDeviceChangedCounter>
<LastDeviceNameOnPG>R5F10PPJ</LastDeviceNameOnPG>
<LastDeviceChangedCounterOnPG>0</LastDeviceChangedCounterOnPG>
@ -1413,6 +1438,18 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
<ItemAddTime>639165234354757189</ItemAddTime>
<ItemAddTimeCount>2</ItemAddTimeCount>
</Instance>
<Instance Guid="9a7db17e-5cda-466f-978d-8303b77df832">
<ItemAddTime>639250729168092529</ItemAddTime>
<ItemAddTimeCount>0</ItemAddTimeCount>
</Instance>
<Instance Guid="242d7df2-3dc6-4f5f-8b8b-288411b62f84">
<ItemAddTime>639250729168092529</ItemAddTime>
<ItemAddTimeCount>1</ItemAddTimeCount>
</Instance>
<Instance Guid="e7bdf87a-97a0-41f8-96d7-299175d81288">
<ItemAddTime>639250729168092529</ItemAddTime>
<ItemAddTimeCount>2</ItemAddTimeCount>
</Instance>
<Instance Guid="0b7e78c3-aadd-45ee-9f9d-ffac6141eeb2">
<TimeTagModified-SourceItem0--0>-8584334295854395005</TimeTagModified-SourceItem0--0>
<SourceItem0-IsLockedByUser>False</SourceItem0-IsLockedByUser>
@ -1456,54 +1493,62 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
<SourceItem9-IsLockedByUser>False</SourceItem9-IsLockedByUser>
<SourceItem9-BuildingTarget-0>True</SourceItem9-BuildingTarget-0>
<SourceItem9-IndividualCompileOption-0>False</SourceItem9-IndividualCompileOption-0>
<TimeTagModified-SourceItem10--0>-8584285259883033236</TimeTagModified-SourceItem10--0>
<TimeTagModified-SourceItem10--0>-8584207126500018619</TimeTagModified-SourceItem10--0>
<SourceItem10-IsLockedByUser>False</SourceItem10-IsLockedByUser>
<SourceItem10-BuildingTarget-0>True</SourceItem10-BuildingTarget-0>
<SourceItem10-IndividualCompileOption-0>False</SourceItem10-IndividualCompileOption-0>
<TimeTagModified-SourceItem11--0>-8584285259163801721</TimeTagModified-SourceItem11--0>
<TimeTagModified-SourceItem11--0>-8584207126500018619</TimeTagModified-SourceItem11--0>
<SourceItem11-IsLockedByUser>False</SourceItem11-IsLockedByUser>
<SourceItem11-BuildingTarget-0>True</SourceItem11-BuildingTarget-0>
<SourceItem11-IndividualCompileOption-0>False</SourceItem11-IndividualCompileOption-0>
<TimeTagModified-SourceItem12--0>-8584285258721384699</TimeTagModified-SourceItem12--0>
<TimeTagModified-SourceItem12--0>-8584285259883033236</TimeTagModified-SourceItem12--0>
<SourceItem12-IsLockedByUser>False</SourceItem12-IsLockedByUser>
<SourceItem12-BuildingTarget-0>True</SourceItem12-BuildingTarget-0>
<SourceItem12-IndividualCompileOption-0>False</SourceItem12-IndividualCompileOption-0>
<TimeTagModified-SourceItem13--0>-8584285258213556128</TimeTagModified-SourceItem13--0>
<TimeTagModified-SourceItem13--0>-8584285259163801721</TimeTagModified-SourceItem13--0>
<SourceItem13-IsLockedByUser>False</SourceItem13-IsLockedByUser>
<SourceItem13-BuildingTarget-0>True</SourceItem13-BuildingTarget-0>
<SourceItem13-IndividualCompileOption-0>False</SourceItem13-IndividualCompileOption-0>
<TimeTagModified-SourceItem14--0>-8584333156752273418</TimeTagModified-SourceItem14--0>
<TimeTagModified-SourceItem14--0>-8584285258721384699</TimeTagModified-SourceItem14--0>
<SourceItem14-IsLockedByUser>False</SourceItem14-IsLockedByUser>
<SourceItem14-BuildingTarget-0>True</SourceItem14-BuildingTarget-0>
<SourceItem14-IndividualCompileOption-0>False</SourceItem14-IndividualCompileOption-0>
<TimeTagModified-SourceItem15--0>-8584333156677193010</TimeTagModified-SourceItem15--0>
<TimeTagModified-SourceItem15--0>-8584285258213556128</TimeTagModified-SourceItem15--0>
<SourceItem15-IsLockedByUser>False</SourceItem15-IsLockedByUser>
<SourceItem15-BuildingTarget-0>True</SourceItem15-BuildingTarget-0>
<SourceItem15-IndividualCompileOption-0>False</SourceItem15-IndividualCompileOption-0>
<TimeTagModified-SourceItem16--0>-8584333156562053237</TimeTagModified-SourceItem16--0>
<TimeTagModified-SourceItem16--0>-8584333156752273418</TimeTagModified-SourceItem16--0>
<SourceItem16-IsLockedByUser>False</SourceItem16-IsLockedByUser>
<SourceItem16-BuildingTarget-0>True</SourceItem16-BuildingTarget-0>
<SourceItem16-IndividualCompileOption-0>False</SourceItem16-IndividualCompileOption-0>
<TimeTagModified-SourceItem17--0>-8584333156436902697</TimeTagModified-SourceItem17--0>
<TimeTagModified-SourceItem17--0>-8584333156677193010</TimeTagModified-SourceItem17--0>
<SourceItem17-IsLockedByUser>False</SourceItem17-IsLockedByUser>
<SourceItem17-BuildingTarget-0>True</SourceItem17-BuildingTarget-0>
<SourceItem17-IndividualCompileOption-0>False</SourceItem17-IndividualCompileOption-0>
<TimeTagModified-SourceItem18--0>-8584332530203484147</TimeTagModified-SourceItem18--0>
<TimeTagModified-SourceItem18--0>-8584333156562053237</TimeTagModified-SourceItem18--0>
<SourceItem18-IsLockedByUser>False</SourceItem18-IsLockedByUser>
<SourceItem18-BuildingTarget-0>True</SourceItem18-BuildingTarget-0>
<SourceItem18-IndividualCompileOption-0>False</SourceItem18-IndividualCompileOption-0>
<TimeTagModified-SourceItem19--0>-8584332399365931506</TimeTagModified-SourceItem19--0>
<TimeTagModified-SourceItem19--0>-8584333156436902697</TimeTagModified-SourceItem19--0>
<SourceItem19-IsLockedByUser>False</SourceItem19-IsLockedByUser>
<SourceItem19-BuildingTarget-0>True</SourceItem19-BuildingTarget-0>
<SourceItem19-IndividualCompileOption-0>False</SourceItem19-IndividualCompileOption-0>
<TimeTagModified-SourceItem20--0>-8584207126500018619</TimeTagModified-SourceItem20--0>
<TimeTagModified-SourceItem20--0>-8584332530203484147</TimeTagModified-SourceItem20--0>
<SourceItem20-IsLockedByUser>False</SourceItem20-IsLockedByUser>
<SourceItem20-BuildingTarget-0>True</SourceItem20-BuildingTarget-0>
<SourceItem20-IndividualCompileOption-0>False</SourceItem20-IndividualCompileOption-0>
<TimeTagModified-SourceItem21--0>-8584207126500018619</TimeTagModified-SourceItem21--0>
<TimeTagModified-SourceItem21--0>-8584332399365931506</TimeTagModified-SourceItem21--0>
<SourceItem21-IsLockedByUser>False</SourceItem21-IsLockedByUser>
<SourceItem21-BuildingTarget-0>True</SourceItem21-BuildingTarget-0>
<SourceItem21-IndividualCompileOption-0>False</SourceItem21-IndividualCompileOption-0>
<TimeTagModified-SourceItem22--0>-8584121631686683279</TimeTagModified-SourceItem22--0>
<SourceItem22-IsLockedByUser>False</SourceItem22-IsLockedByUser>
<SourceItem22-BuildingTarget-0>True</SourceItem22-BuildingTarget-0>
<SourceItem22-IndividualCompileOption-0>False</SourceItem22-IndividualCompileOption-0>
<TimeTagModified-SourceItem23--0>-8584121631686673081</TimeTagModified-SourceItem23--0>
<SourceItem23-IsLockedByUser>False</SourceItem23-IsLockedByUser>
<SourceItem23-BuildingTarget-0>True</SourceItem23-BuildingTarget-0>
<SourceItem23-IndividualCompileOption-0>False</SourceItem23-IndividualCompileOption-0>
</Instance>
</Class>
<Class Guid="44fa27c9-0aa0-4297-bd3b-2c5c5bdb8881">
@ -4459,7 +4504,7 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
&lt;/RTC1HZ&gt;
&lt;RXD0 Name="RXD0" Text="enable" /&gt;
&lt;ProjectName Name="PrjName" Text="multical" /&gt;
&lt;ProjectPath Name="PrjPath" Text="C:\Users\temp\Desktop\measurement_fw" /&gt;
&lt;ProjectPath Name="PrjPath" Text="C:\Users\temp\Desktop\Amo\2ch_fw" /&gt;
&lt;ProjectKind Name="PrjKind" Text="Project78K0R" /&gt;
&lt;DeviceName Name="DeviceName" Fixed="" Text="RL78F14" /&gt;
&lt;MCUName Name="MCUName" Text="RL78F14_100pin" /&gt;
@ -4617,7 +4662,7 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
&lt;P67 Name="P67/TI02/TO02" AltFunc="P67" Point="I/O" /&gt;
&lt;/Port6&gt;
&lt;Port7 Chip="R5F10PLG,R5F10PLH,R5F10PLJ,R5F10PMG,R5F10PMH,R5F10PMJ,RL78F14_100pin" Pullup="true"&gt;
&lt;P70 Name="P70/ANI26/KR0/TI15/TO15/INTP8/SI11/SDA11/SNZOUT4/KR0" DIN="true" TTL="true" PITHL="true" Nch="true" AltFunc="P70" Point="I/O" /&gt;
&lt;P70 Name="P70/ANI26/KR0/TI15/TO15/INTP8/SI11/SDA11/SNZOUT4/KR0" DIN="true" TTL="true" PITHL="true" Nch="true" AltFunc="TI15" Point="I/O" /&gt;
&lt;P71 Name="P71/ANI27/KR1/TI17/TO17/INTP6/_SCK11/SCL11/SNZOUT5/KR1" DIN="true" TTL="true" PITHL="true" Nch="true" AltFunc="" Point="I/O" /&gt;
&lt;P72 Name="P72/ANI28/KR2/CTXD0/SO11/SNZOUT6/KR2" DIN="true" Nch="true" AltFunc="" Point="I/O" /&gt;
&lt;P73 Name="P73/ANI29/KR3/CRXD0/_SSI11/SNZOUT7/KR3" DIN="true" TTL="true" PITHL="true" AltFunc="" Point="I/O" /&gt;
@ -5081,7 +5126,7 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
&lt;INTTM14 InUse="0" ISR="r_tau1_channel4_interrupt" /&gt;
&lt;/Channel4&gt;
&lt;Channel5&gt;
&lt;INTTM15 InUse="0" ISR="r_tau1_channel5_interrupt" /&gt;
&lt;INTTM15 InUse="1" ISR="r_tau1_channel5_interrupt" /&gt;
&lt;/Channel5&gt;
&lt;Channel6&gt;
&lt;INTTM16 InUse="0" ISR="r_tau1_channel6_interrupt" /&gt;
@ -5508,7 +5553,7 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
&lt;r_cg_adc.h UserName="r_cg_adc.h" LibName=".h" InUse="0" /&gt;
&lt;/ADC&gt;
&lt;TAU&gt;
&lt;r_cg_timer.c UserName="r_cg_timer.c" LibName=".c" InUse="0"&gt;
&lt;r_cg_timer.c UserName="r_cg_timer.c" LibName=".c" InUse="1"&gt;
&lt;Type R_TAU_Create="void R_TAU_Create(void)" R_TAU_Set_PowerOff="void R_TAU_Set_PowerOff(void)" R_TAU_Channeln_Start="void R_TAU_Channeln_Start(void)" R_TAU_Channeln_Higher8bits_Start="void R_TAU_Channeln_Higher8bits_Start(void)" R_TAU_Channeln_Lower8bits_Start="void R_TAU_Channeln_Lower8bits_Start(void)" R_TAU_Channeln_Stop="void R_TAU_Channeln_Stop(void)" R_TAU_Channeln_Higher8bits_Stop="void R_TAU_Channeln_Higher8bits_Stop(void)" R_TAU_Channeln_Lower8bits_Stop="void R_TAU_Channeln_Lower8bits_Stop(void)" R_TAU_Channeln_Get_PulseWidth="void R_TAU_Channeln_Get_PulseWidth(uint32_t * const width)" R_TAU_Channeln_Set_SoftwareTriggerOn="void R_TAU_Channeln_Set_SoftwareTriggerOn(void)" R_WUTM_Create="void R_WUTM_Create(void)" R_WUTM_Start="void R_WUTM_Start(void)" R_WUTM_Stop="void R_WUTM_Stop(void)" R_WUTM_Set_PowerOff="void R_WUTM_Set_PowerOff(void)" /&gt;
&lt;TAU0&gt;
&lt;R_TAU0_Create UserName="R_TAU0_Create" LibName="R_TAU_Create" InUse="0" Init="1" InitMode="" /&gt;
@ -5567,7 +5612,7 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
&lt;/Channel7&gt;
&lt;/TAU0&gt;
&lt;TAU1&gt;
&lt;R_TAU1_Create UserName="R_TAU1_Create" LibName="R_TAU_Create" InUse="0" Init="1" InitMode="" /&gt;
&lt;R_TAU1_Create UserName="R_TAU1_Create" LibName="R_TAU_Create" InUse="1" Init="1" InitMode="" /&gt;
&lt;R_TAU1_Set_PowerOff UserName="R_TAU1_Set_PowerOff" LibName="R_TAU_Set_PowerOff" InUse="0" /&gt;
&lt;Channel0 InUse=""&gt;
&lt;R_TAU1_Channel0_Start UserName="R_TAU1_Channel0_Start" LibName="R_TAU_Channeln_Start" InUse="0" /&gt;
@ -5606,9 +5651,9 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
&lt;R_TAU1_Channel4_Set_SoftwareTriggerOn UserName="R_TAU1_Channel4_Set_SoftwareTriggerOn" LibName="R_TAU_Channeln_Set_SoftwareTriggerOn" InUse="0" /&gt;
&lt;/Channel4&gt;
&lt;Channel5 Chip="R5F10PGG,R5F10PGH,R5F10PGJ,R5F10PLG,R5F10PLH,R5F10PLJ,R5F10PMG,R5F10PMH,R5F10PMJ,RL78F14_100pin" InUse=""&gt;
&lt;R_TAU1_Channel5_Start UserName="R_TAU1_Channel5_Start" LibName="R_TAU_Channeln_Start" InUse="0" /&gt;
&lt;R_TAU1_Channel5_Stop UserName="R_TAU1_Channel5_Stop" LibName="R_TAU_Channeln_Stop" InUse="0" /&gt;
&lt;R_TAU1_Channel5_Get_PulseWidth Chip="RL78F14_80pin,RL78F14_100pin" UserName="R_TAU1_Channel5_Get_PulseWidth" LibName="R_TAU_Channeln_Get_PulseWidth" InUse="0" /&gt;
&lt;R_TAU1_Channel5_Start UserName="R_TAU1_Channel5_Start" LibName="R_TAU_Channeln_Start" InUse="1" /&gt;
&lt;R_TAU1_Channel5_Stop UserName="R_TAU1_Channel5_Stop" LibName="R_TAU_Channeln_Stop" InUse="1" /&gt;
&lt;R_TAU1_Channel5_Get_PulseWidth Chip="RL78F14_80pin,RL78F14_100pin" UserName="R_TAU1_Channel5_Get_PulseWidth" LibName="R_TAU_Channeln_Get_PulseWidth" InUse="1" /&gt;
&lt;/Channel5&gt;
&lt;Channel6 Chip="R5F10PGG,R5F10PGH,R5F10PGJ,R5F10PLG,R5F10PLH,R5F10PLJ,R5F10PMG,R5F10PMH,R5F10PMJ,RL78F14_100pin" InUse=""&gt;
&lt;R_TAU1_Channel6_Start UserName="R_TAU1_Channel6_Start" LibName="R_TAU_Channeln_Start" InUse="0" /&gt;
@ -5648,7 +5693,7 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
&lt;R_TMR_RD1_ForcedOutput_Stop UserName="R_TMR_RD1_ForcedOutput_Stop" LibName="R_TMR_RDn_ForcedOutput_Stop" InUse="0" /&gt;
&lt;/TMRD1&gt;
&lt;/r_cg_timer.c&gt;
&lt;r_cg_timer_user.c UserName="r_cg_timer_user.c" LibName="_user.c" InUse="0"&gt;
&lt;r_cg_timer_user.c UserName="r_cg_timer_user.c" LibName="_user.c" InUse="1"&gt;
&lt;Type R_TAU_Create_UserInit="void R_TAUn_Create_UserInit(void)" r_tau_channeln_interrupt="__interrupt static void r_tau_channeln_interrupt(void)" r_tau_channeln_higher8bits_interrupt="__interrupt static void r_tau_channeln_higher8bits_interrupt(void)" R_WUTM_Create_UserInit="void R_WUTM_Create_UserInit(void)" r_wutm_interrupt="__interrupt static void r_wutm_interrupt(void)" /&gt;
&lt;TAU0&gt;
&lt;R_TAU0_Create_UserInit UserName="R_TAU0_Create_UserInit" LibName="R_TAU_Create_UserInit" InUse="0" /&gt;
@ -5699,7 +5744,7 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
&lt;r_tau1_channel4_interrupt UserName="r_tau1_channel4_interrupt" INTHandle="" LibName="r_tau_channeln_interrupt" InUse="0" /&gt;
&lt;/Channel4&gt;
&lt;Channel5 Chip="R5F10PGG,R5F10PGH,R5F10PGJ,R5F10PLG,R5F10PLH,R5F10PLJ,R5F10PMG,R5F10PMH,R5F10PMJ,RL78F14_100pin" InUse=""&gt;
&lt;r_tau1_channel5_interrupt UserName="r_tau1_channel5_interrupt" INTHandle="" LibName="r_tau_channeln_interrupt" InUse="0" /&gt;
&lt;r_tau1_channel5_interrupt UserName="r_tau1_channel5_interrupt" INTHandle="" LibName="r_tau_channeln_interrupt" InUse="1" /&gt;
&lt;/Channel5&gt;
&lt;Channel6 Chip="R5F10PGG,R5F10PGH,R5F10PGJ,R5F10PLG,R5F10PLH,R5F10PLJ,R5F10PMG,R5F10PMH,R5F10PMJ,RL78F14_100pin" InUse=""&gt;
&lt;r_tau1_channel6_interrupt UserName="r_tau1_channel6_interrupt" INTHandle="" LibName="r_tau_channeln_interrupt" InUse="0" /&gt;
@ -5721,7 +5766,7 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
&lt;r_tmr_rd1_interrupt UserName="r_tmr_rd1_interrupt" LibName="r_tmr_rdn_interrupt" INTHandle="" InUse="0" /&gt;
&lt;/TMRD1&gt;
&lt;/r_cg_timer_user.c&gt;
&lt;r_cg_timer.h UserName="r_cg_timer.h" LibName=".h" InUse="0" /&gt;
&lt;r_cg_timer.h UserName="r_cg_timer.h" LibName=".h" InUse="1" /&gt;
&lt;/TAU&gt;
&lt;WDT&gt;
&lt;r_cg_wdt.c UserName="r_cg_wdt.c" LibName=".c" InUse="1"&gt;
@ -6019,9 +6064,9 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
&lt;ADC SetFlag="False" HelpID="adc" NeedRefresh="False"&gt;
&lt;ADC SetFlag="False" MacroName="ADC" /&gt;
&lt;/ADC&gt;
&lt;TAU SetFlag="False" HelpID="timer" NeedRefresh="False"&gt;
&lt;TAU SetFlag="True" HelpID="timer" NeedRefresh="False"&gt;
&lt;TAU0 Accelerate="No" MacroName="TAU" Channel="0" ChannelNum="0,1,2,3,4,5,6,7" SetFlag="False" TabEnable="True" /&gt;
&lt;TAU1 Accelerate="No" Chip="R5F10PGG,R5F10PGH,R5F10PGJ,R5F10PGG,R5F10PGH,R5F10PGJ,R5F10PLG,R5F10PLH,R5F10PLJ,R5F10PMG,R5F10PMH,R5F10PMJ,RL78F14_100pin" MacroName="TAU" Channel="1" ChannelNum="0,1,2,3,4,5,6,7" SetFlag="False" TabEnable="True" /&gt;
&lt;TAU1 Accelerate="No" Chip="R5F10PGG,R5F10PGH,R5F10PGJ,R5F10PGG,R5F10PGH,R5F10PGJ,R5F10PLG,R5F10PLH,R5F10PLJ,R5F10PMG,R5F10PMH,R5F10PMJ,RL78F14_100pin" MacroName="TAU" Channel="1" ChannelNum="0,1,2,3,4,5,6,7" SetFlag="True" TabEnable="True" /&gt;
&lt;TMRJ0 SetFlag="False" MacroName="TMRJ" Channel="0" TabEnable="True" /&gt;
&lt;TMRD0 SetFlag="False" MacroName="TMRD" Channel="0" TabEnable="True" /&gt;
&lt;TMRD1 SetFlag="False" MacroName="TMRD" Channel="1" TabEnable="True" /&gt;
@ -6770,9 +6815,9 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
&lt;/PortP6&gt;
&lt;PortP7&gt;
&lt;P70&gt;
&lt;setting name="MODULE_UNUSED" value="false" /&gt;
&lt;setting name="MODULE_UNUSED" value="true" /&gt;
&lt;setting name="INPUT_MODE" value="false" /&gt;
&lt;setting name="OUTPUT_MODE" value="true" /&gt;
&lt;setting name="OUTPUT_MODE" value="false" /&gt;
&lt;setting name="PULLUP_ON" value="false" /&gt;
&lt;setting name="NCH_ON" value="false" /&gt;
&lt;setting name="OUTPUT_1" value="false" /&gt;
@ -7454,8 +7499,33 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
&lt;setting name="Pinselection" value="-1" /&gt;
&lt;/Channel4&gt;
&lt;Channel5&gt;
&lt;setting name="ChannelFunction" value="0" /&gt;
&lt;setting name="ChannelFunction" value="4" /&gt;
&lt;setting name="Pinselection" value="-1" /&gt;
&lt;TAUIntervalMeasure5&gt;
&lt;setting name="MeasureRang" value="0.063 (µs) &amp;lt; TI15 &amp;lt; 4.096 (ms)" /&gt;
&lt;setting name="Noise_filter" value="used" /&gt;
&lt;setting name="TI0_input_edge" value="both" /&gt;
&lt;setting name="Interrupt" value="used" /&gt;
&lt;setting name="Generate_interrupt_when_counting_started" value="no" /&gt;
&lt;setting name="Interrupt_priority" value="0" /&gt;
&lt;setting name="Input_source" value="TI05" /&gt;
&lt;/TAUIntervalMeasure5&gt;
&lt;TAUInterval5&gt;
&lt;setting name="OperationMode" value="16bits" /&gt;
&lt;setting name="Count_clock" value="MCK clock" /&gt;
&lt;setting name="Sub_clock_mode" value="-1" /&gt;
&lt;setting name="Interval_value" value="100" /&gt;
&lt;setting name="Value_scale" value="1" /&gt;
&lt;setting name="Intervalvalue_High8bits" value="100" /&gt;
&lt;setting name="Intervalvalue_High8bits_scale" value="-1" /&gt;
&lt;setting name="Intervalvalue_Low8bits" value="100" /&gt;
&lt;setting name="Intervalvalue_Low8bits_Scale" value="-1" /&gt;
&lt;setting name="Generate_interrupt_when_couting_started" value="no" /&gt;
&lt;setting name="Interrupt" value="used" /&gt;
&lt;setting name="Interrupt_priority" value="3" /&gt;
&lt;setting name="InterruptH_priority" value="3" /&gt;
&lt;setting name="InterruptH8" value="unused" /&gt;
&lt;/TAUInterval5&gt;
&lt;/Channel5&gt;
&lt;Channel6&gt;
&lt;setting name="ChannelFunction" value="0" /&gt;

62
multical.rcpe

@ -27,6 +27,9 @@
<Path>r_cg_wdt.c</Path>
<Path>r_cg_wdt_user.c</Path>
<Path>r_cg_wdt.h</Path>
<Path>r_cg_timer.c</Path>
<Path>r_cg_timer_user.c</Path>
<Path>r_cg_timer.h</Path>
</Category>
<Category Name="drivers">
<Category Name="OWI">
@ -97,6 +100,8 @@
<Path>DefaultBuild\app_owi_service.obj</Path>
<Path>DefaultBuild\r_cg_wdt.obj</Path>
<Path>DefaultBuild\r_cg_wdt_user.obj</Path>
<Path>DefaultBuild\r_cg_timer.obj</Path>
<Path>DefaultBuild\r_cg_timer_user.obj</Path>
</LinkOrder>
<CommonOptions>
<IncludePathForC>..\..\Documents\카카오톡 받은 파일\IDH1.1\IDH1.1</IncludePathForC>
@ -397,7 +402,7 @@
&lt;/RTC1HZ&gt;
&lt;RXD0 Name="RXD0" Text="enable" /&gt;
&lt;ProjectName Name="PrjName" Text="multical" /&gt;
&lt;ProjectPath Name="PrjPath" Text="C:\Users\temp\Desktop\measurement_fw" /&gt;
&lt;ProjectPath Name="PrjPath" Text="C:\Users\temp\Desktop\Amo\2ch_fw" /&gt;
&lt;ProjectKind Name="PrjKind" Text="Project78K0R" /&gt;
&lt;DeviceName Name="DeviceName" Fixed="" Text="RL78F14" /&gt;
&lt;MCUName Name="MCUName" Text="RL78F14_100pin" /&gt;
@ -555,7 +560,7 @@
&lt;P67 Name="P67/TI02/TO02" AltFunc="P67" Point="I/O" /&gt;
&lt;/Port6&gt;
&lt;Port7 Chip="R5F10PLG,R5F10PLH,R5F10PLJ,R5F10PMG,R5F10PMH,R5F10PMJ,RL78F14_100pin" Pullup="true"&gt;
&lt;P70 Name="P70/ANI26/KR0/TI15/TO15/INTP8/SI11/SDA11/SNZOUT4/KR0" DIN="true" TTL="true" PITHL="true" Nch="true" AltFunc="P70" Point="I/O" /&gt;
&lt;P70 Name="P70/ANI26/KR0/TI15/TO15/INTP8/SI11/SDA11/SNZOUT4/KR0" DIN="true" TTL="true" PITHL="true" Nch="true" AltFunc="TI15" Point="I/O" /&gt;
&lt;P71 Name="P71/ANI27/KR1/TI17/TO17/INTP6/_SCK11/SCL11/SNZOUT5/KR1" DIN="true" TTL="true" PITHL="true" Nch="true" AltFunc="" Point="I/O" /&gt;
&lt;P72 Name="P72/ANI28/KR2/CTXD0/SO11/SNZOUT6/KR2" DIN="true" Nch="true" AltFunc="" Point="I/O" /&gt;
&lt;P73 Name="P73/ANI29/KR3/CRXD0/_SSI11/SNZOUT7/KR3" DIN="true" TTL="true" PITHL="true" AltFunc="" Point="I/O" /&gt;
@ -1019,7 +1024,7 @@
&lt;INTTM14 InUse="0" ISR="r_tau1_channel4_interrupt" /&gt;
&lt;/Channel4&gt;
&lt;Channel5&gt;
&lt;INTTM15 InUse="0" ISR="r_tau1_channel5_interrupt" /&gt;
&lt;INTTM15 InUse="1" ISR="r_tau1_channel5_interrupt" /&gt;
&lt;/Channel5&gt;
&lt;Channel6&gt;
&lt;INTTM16 InUse="0" ISR="r_tau1_channel6_interrupt" /&gt;
@ -1446,7 +1451,7 @@
&lt;r_cg_adc.h UserName="r_cg_adc.h" LibName=".h" InUse="0" /&gt;
&lt;/ADC&gt;
&lt;TAU&gt;
&lt;r_cg_timer.c UserName="r_cg_timer.c" LibName=".c" InUse="0"&gt;
&lt;r_cg_timer.c UserName="r_cg_timer.c" LibName=".c" InUse="1"&gt;
&lt;Type R_TAU_Create="void R_TAU_Create(void)" R_TAU_Set_PowerOff="void R_TAU_Set_PowerOff(void)" R_TAU_Channeln_Start="void R_TAU_Channeln_Start(void)" R_TAU_Channeln_Higher8bits_Start="void R_TAU_Channeln_Higher8bits_Start(void)" R_TAU_Channeln_Lower8bits_Start="void R_TAU_Channeln_Lower8bits_Start(void)" R_TAU_Channeln_Stop="void R_TAU_Channeln_Stop(void)" R_TAU_Channeln_Higher8bits_Stop="void R_TAU_Channeln_Higher8bits_Stop(void)" R_TAU_Channeln_Lower8bits_Stop="void R_TAU_Channeln_Lower8bits_Stop(void)" R_TAU_Channeln_Get_PulseWidth="void R_TAU_Channeln_Get_PulseWidth(uint32_t * const width)" R_TAU_Channeln_Set_SoftwareTriggerOn="void R_TAU_Channeln_Set_SoftwareTriggerOn(void)" R_WUTM_Create="void R_WUTM_Create(void)" R_WUTM_Start="void R_WUTM_Start(void)" R_WUTM_Stop="void R_WUTM_Stop(void)" R_WUTM_Set_PowerOff="void R_WUTM_Set_PowerOff(void)" /&gt;
&lt;TAU0&gt;
&lt;R_TAU0_Create UserName="R_TAU0_Create" LibName="R_TAU_Create" InUse="0" Init="1" InitMode="" /&gt;
@ -1505,7 +1510,7 @@
&lt;/Channel7&gt;
&lt;/TAU0&gt;
&lt;TAU1&gt;
&lt;R_TAU1_Create UserName="R_TAU1_Create" LibName="R_TAU_Create" InUse="0" Init="1" InitMode="" /&gt;
&lt;R_TAU1_Create UserName="R_TAU1_Create" LibName="R_TAU_Create" InUse="1" Init="1" InitMode="" /&gt;
&lt;R_TAU1_Set_PowerOff UserName="R_TAU1_Set_PowerOff" LibName="R_TAU_Set_PowerOff" InUse="0" /&gt;
&lt;Channel0 InUse=""&gt;
&lt;R_TAU1_Channel0_Start UserName="R_TAU1_Channel0_Start" LibName="R_TAU_Channeln_Start" InUse="0" /&gt;
@ -1544,9 +1549,9 @@
&lt;R_TAU1_Channel4_Set_SoftwareTriggerOn UserName="R_TAU1_Channel4_Set_SoftwareTriggerOn" LibName="R_TAU_Channeln_Set_SoftwareTriggerOn" InUse="0" /&gt;
&lt;/Channel4&gt;
&lt;Channel5 Chip="R5F10PGG,R5F10PGH,R5F10PGJ,R5F10PLG,R5F10PLH,R5F10PLJ,R5F10PMG,R5F10PMH,R5F10PMJ,RL78F14_100pin" InUse=""&gt;
&lt;R_TAU1_Channel5_Start UserName="R_TAU1_Channel5_Start" LibName="R_TAU_Channeln_Start" InUse="0" /&gt;
&lt;R_TAU1_Channel5_Stop UserName="R_TAU1_Channel5_Stop" LibName="R_TAU_Channeln_Stop" InUse="0" /&gt;
&lt;R_TAU1_Channel5_Get_PulseWidth Chip="RL78F14_80pin,RL78F14_100pin" UserName="R_TAU1_Channel5_Get_PulseWidth" LibName="R_TAU_Channeln_Get_PulseWidth" InUse="0" /&gt;
&lt;R_TAU1_Channel5_Start UserName="R_TAU1_Channel5_Start" LibName="R_TAU_Channeln_Start" InUse="1" /&gt;
&lt;R_TAU1_Channel5_Stop UserName="R_TAU1_Channel5_Stop" LibName="R_TAU_Channeln_Stop" InUse="1" /&gt;
&lt;R_TAU1_Channel5_Get_PulseWidth Chip="RL78F14_80pin,RL78F14_100pin" UserName="R_TAU1_Channel5_Get_PulseWidth" LibName="R_TAU_Channeln_Get_PulseWidth" InUse="1" /&gt;
&lt;/Channel5&gt;
&lt;Channel6 Chip="R5F10PGG,R5F10PGH,R5F10PGJ,R5F10PLG,R5F10PLH,R5F10PLJ,R5F10PMG,R5F10PMH,R5F10PMJ,RL78F14_100pin" InUse=""&gt;
&lt;R_TAU1_Channel6_Start UserName="R_TAU1_Channel6_Start" LibName="R_TAU_Channeln_Start" InUse="0" /&gt;
@ -1586,7 +1591,7 @@
&lt;R_TMR_RD1_ForcedOutput_Stop UserName="R_TMR_RD1_ForcedOutput_Stop" LibName="R_TMR_RDn_ForcedOutput_Stop" InUse="0" /&gt;
&lt;/TMRD1&gt;
&lt;/r_cg_timer.c&gt;
&lt;r_cg_timer_user.c UserName="r_cg_timer_user.c" LibName="_user.c" InUse="0"&gt;
&lt;r_cg_timer_user.c UserName="r_cg_timer_user.c" LibName="_user.c" InUse="1"&gt;
&lt;Type R_TAU_Create_UserInit="void R_TAUn_Create_UserInit(void)" r_tau_channeln_interrupt="__interrupt static void r_tau_channeln_interrupt(void)" r_tau_channeln_higher8bits_interrupt="__interrupt static void r_tau_channeln_higher8bits_interrupt(void)" R_WUTM_Create_UserInit="void R_WUTM_Create_UserInit(void)" r_wutm_interrupt="__interrupt static void r_wutm_interrupt(void)" /&gt;
&lt;TAU0&gt;
&lt;R_TAU0_Create_UserInit UserName="R_TAU0_Create_UserInit" LibName="R_TAU_Create_UserInit" InUse="0" /&gt;
@ -1637,7 +1642,7 @@
&lt;r_tau1_channel4_interrupt UserName="r_tau1_channel4_interrupt" INTHandle="" LibName="r_tau_channeln_interrupt" InUse="0" /&gt;
&lt;/Channel4&gt;
&lt;Channel5 Chip="R5F10PGG,R5F10PGH,R5F10PGJ,R5F10PLG,R5F10PLH,R5F10PLJ,R5F10PMG,R5F10PMH,R5F10PMJ,RL78F14_100pin" InUse=""&gt;
&lt;r_tau1_channel5_interrupt UserName="r_tau1_channel5_interrupt" INTHandle="" LibName="r_tau_channeln_interrupt" InUse="0" /&gt;
&lt;r_tau1_channel5_interrupt UserName="r_tau1_channel5_interrupt" INTHandle="" LibName="r_tau_channeln_interrupt" InUse="1" /&gt;
&lt;/Channel5&gt;
&lt;Channel6 Chip="R5F10PGG,R5F10PGH,R5F10PGJ,R5F10PLG,R5F10PLH,R5F10PLJ,R5F10PMG,R5F10PMH,R5F10PMJ,RL78F14_100pin" InUse=""&gt;
&lt;r_tau1_channel6_interrupt UserName="r_tau1_channel6_interrupt" INTHandle="" LibName="r_tau_channeln_interrupt" InUse="0" /&gt;
@ -1659,7 +1664,7 @@
&lt;r_tmr_rd1_interrupt UserName="r_tmr_rd1_interrupt" LibName="r_tmr_rdn_interrupt" INTHandle="" InUse="0" /&gt;
&lt;/TMRD1&gt;
&lt;/r_cg_timer_user.c&gt;
&lt;r_cg_timer.h UserName="r_cg_timer.h" LibName=".h" InUse="0" /&gt;
&lt;r_cg_timer.h UserName="r_cg_timer.h" LibName=".h" InUse="1" /&gt;
&lt;/TAU&gt;
&lt;WDT&gt;
&lt;r_cg_wdt.c UserName="r_cg_wdt.c" LibName=".c" InUse="1"&gt;
@ -1957,9 +1962,9 @@
&lt;ADC SetFlag="False" HelpID="adc" NeedRefresh="False"&gt;
&lt;ADC SetFlag="False" MacroName="ADC" /&gt;
&lt;/ADC&gt;
&lt;TAU SetFlag="False" HelpID="timer" NeedRefresh="False"&gt;
&lt;TAU SetFlag="True" HelpID="timer" NeedRefresh="False"&gt;
&lt;TAU0 Accelerate="No" MacroName="TAU" Channel="0" ChannelNum="0,1,2,3,4,5,6,7" SetFlag="False" TabEnable="True" /&gt;
&lt;TAU1 Accelerate="No" Chip="R5F10PGG,R5F10PGH,R5F10PGJ,R5F10PGG,R5F10PGH,R5F10PGJ,R5F10PLG,R5F10PLH,R5F10PLJ,R5F10PMG,R5F10PMH,R5F10PMJ,RL78F14_100pin" MacroName="TAU" Channel="1" ChannelNum="0,1,2,3,4,5,6,7" SetFlag="False" TabEnable="True" /&gt;
&lt;TAU1 Accelerate="No" Chip="R5F10PGG,R5F10PGH,R5F10PGJ,R5F10PGG,R5F10PGH,R5F10PGJ,R5F10PLG,R5F10PLH,R5F10PLJ,R5F10PMG,R5F10PMH,R5F10PMJ,RL78F14_100pin" MacroName="TAU" Channel="1" ChannelNum="0,1,2,3,4,5,6,7" SetFlag="True" TabEnable="True" /&gt;
&lt;TMRJ0 SetFlag="False" MacroName="TMRJ" Channel="0" TabEnable="True" /&gt;
&lt;TMRD0 SetFlag="False" MacroName="TMRD" Channel="0" TabEnable="True" /&gt;
&lt;TMRD1 SetFlag="False" MacroName="TMRD" Channel="1" TabEnable="True" /&gt;
@ -2708,9 +2713,9 @@
&lt;/PortP6&gt;
&lt;PortP7&gt;
&lt;P70&gt;
&lt;setting name="MODULE_UNUSED" value="false" /&gt;
&lt;setting name="MODULE_UNUSED" value="true" /&gt;
&lt;setting name="INPUT_MODE" value="false" /&gt;
&lt;setting name="OUTPUT_MODE" value="true" /&gt;
&lt;setting name="OUTPUT_MODE" value="false" /&gt;
&lt;setting name="PULLUP_ON" value="false" /&gt;
&lt;setting name="NCH_ON" value="false" /&gt;
&lt;setting name="OUTPUT_1" value="false" /&gt;
@ -3392,8 +3397,33 @@
&lt;setting name="Pinselection" value="-1" /&gt;
&lt;/Channel4&gt;
&lt;Channel5&gt;
&lt;setting name="ChannelFunction" value="0" /&gt;
&lt;setting name="ChannelFunction" value="4" /&gt;
&lt;setting name="Pinselection" value="-1" /&gt;
&lt;TAUIntervalMeasure5&gt;
&lt;setting name="MeasureRang" value="0.063 (µs) &amp;lt; TI15 &amp;lt; 4.096 (ms)" /&gt;
&lt;setting name="Noise_filter" value="used" /&gt;
&lt;setting name="TI0_input_edge" value="both" /&gt;
&lt;setting name="Interrupt" value="used" /&gt;
&lt;setting name="Generate_interrupt_when_counting_started" value="no" /&gt;
&lt;setting name="Interrupt_priority" value="0" /&gt;
&lt;setting name="Input_source" value="TI05" /&gt;
&lt;/TAUIntervalMeasure5&gt;
&lt;TAUInterval5&gt;
&lt;setting name="OperationMode" value="16bits" /&gt;
&lt;setting name="Count_clock" value="MCK clock" /&gt;
&lt;setting name="Sub_clock_mode" value="-1" /&gt;
&lt;setting name="Interval_value" value="100" /&gt;
&lt;setting name="Value_scale" value="1" /&gt;
&lt;setting name="Intervalvalue_High8bits" value="100" /&gt;
&lt;setting name="Intervalvalue_High8bits_scale" value="-1" /&gt;
&lt;setting name="Intervalvalue_Low8bits" value="100" /&gt;
&lt;setting name="Intervalvalue_Low8bits_Scale" value="-1" /&gt;
&lt;setting name="Generate_interrupt_when_couting_started" value="no" /&gt;
&lt;setting name="Interrupt" value="used" /&gt;
&lt;setting name="Interrupt_priority" value="3" /&gt;
&lt;setting name="InterruptH_priority" value="3" /&gt;
&lt;setting name="InterruptH8" value="unused" /&gt;
&lt;/TAUInterval5&gt;
&lt;/Channel5&gt;
&lt;Channel6&gt;
&lt;setting name="ChannelFunction" value="0" /&gt;

186
multical.temp.mtud

File diff suppressed because one or more lines are too long

324
owi.c

@ -1,11 +1,36 @@
#include "owi.h"
#include "r_cg_wdt.h"
#include "delay.h"
#include "r_cg_timer.h"
#include "r_cg_cgc.h"
#include <string.h>
/* 내부 상태 */
#ifndef OWI_USE_TAU1_CAPTURE
#define OWI_USE_TAU1_CAPTURE 1u
#endif
/* Renesas CG: count-clock period is half the selected 0.063 us minimum.
Therefore TI15 capture runs at approximately 32 timer ticks per us. */
#define OWI_TAU1_TICKS_PER_US 32UL
#define OWI_CAPTURE_QUEUE_WAIT_US (bit_period_us * 4u)
#define OWI_CAPTURE_SYNC_BITS 16u
/* 내부 상태 */
static uint32_t bit_period_us = OWI_BIT_PERIOD_US;
static uint8_t g_owi_timeout_latched = 0;
/* 0=none, 1=no pulse, 2=queue overflow, 3=header mismatch. */
static uint8_t g_capture_error = 0U;
static uint16_t g_capture_sync = 0U;
uint8_t OWI_GetCaptureError(void) { return g_capture_error; }
uint16_t OWI_GetCaptureSync(void) { return g_capture_sync; }
#if OWI_USE_TAU1_CAPTURE
static uint32_t g_owi_capture_threshold_ticks = 0UL;
static uint8_t g_owi_capture_pending_bits[OWI_CAPTURE_SYNC_BITS];
static uint8_t g_owi_capture_pending_index = 0U;
static uint8_t g_owi_capture_pending_count = 0U;
#endif
static uint16_t g_owi_last_timeout_byte_index = 0xFFFFu;
static uint8_t g_owi_last_timeout_bit_index = 0xFFu;
@ -16,6 +41,7 @@ static uint8_t g_owi_current_read_bit_index = 0u;
static void OWI_KickWdt(void)
{
R_WDT_Restart();
NVM_TraceStack();
}
/* =========================================================
@ -67,6 +93,8 @@ uint8_t OWI_HasTimeout(void)
void OWI_ClearTimeout(void)
{
g_owi_timeout_latched = 0;
g_capture_error = 0U;
g_capture_sync = 0U;
g_owi_last_timeout_byte_index = 0xFFFFu;
g_owi_last_timeout_bit_index = 0xFFu;
}
@ -88,6 +116,8 @@ void OWI_Init(uint32_t bit_time_us)
{
bit_period_us = bit_time_us;
(void)bit_period_us;
PMC7 &= (uint8_t)~OWI_PIN_MASK;
PIM7 &= (uint8_t)~OWI_PIN_MASK;
OWI_PORT_POM |= (uint8_t)OWI_PIN_MASK;
OWI_PORT_PU &= (uint8_t)~OWI_PIN_MASK;
@ -168,6 +198,262 @@ static uint8_t OWI_ReadByte_StreamSynced(uint16_t byte_index)
return data;
}
#if OWI_USE_TAU1_CAPTURE
static void OWI_CapturePrepare(void)
{
/* P70 remains a normal open-drain GPIO at boot. Configure TI15 only
immediately before a captured receive transaction. */
/* R_Systeminit configured TAU1; do not reset unrelated channels. */
R_TAU1_Channel5_Stop();
/* Slow RC rising edges on P70 benefit from the TI15 digital noise filter.
Give capture precedence over UART interrupts while receiving a frame. */
NFEN2 |= _20_TAU_CH5_NOISE_ON;
TMPR115 = 0U;
TMPR015 = 0U;
GPIO_Input();
}
static void OWI_CaptureBegin(void)
{
/* Arm while the master still holds the final address LOW.
Its release is the first edge; the first complete slave LOW follows. */
g_owi_capture_threshold_ticks = 0UL;
g_owi_capture_pending_index = 0U;
g_owi_capture_pending_count = 0U;
R_TAU1_Channel5_CaptureReset();
g_trace_stage = 7U;
R_TAU1_Channel5_Start();
}
/* Send the read address and arm capture BEFORE releasing its final LOW.
Otherwise the GPIO/function-return overhead can lose the first response bit. */
static void OWI_WriteCapturedReadAddress(uint8_t address)
{
int b;
uint32_t t_low = (address & 1U) ? (uint32_t)TLOW_1 : (uint32_t)TLOW_0;
for (b = 7; b > 0; b--) OWI_WriteBit((address >> b) & 1U);
OWI_Release();
delay_us((uint32_t)TBIT - t_low);
OWI_DriveLow();
delay_us(t_low);
OWI_CaptureBegin();
OWI_Release();
}
static void OWI_CaptureEnd(void)
{
R_TAU1_Channel5_Stop();
GPIO_Input();
}
static uint8_t OWI_CaptureWaitLowWidth(uint16_t byte_index,
uint8_t bit_index,
uint32_t * const low_ticks)
{
uint32_t timeout_us = OWI_CAPTURE_QUEUE_WAIT_US;
while (timeout_us-- > 0UL)
{
/* Keep the bounded wait alive even when the input stays idle. */
if ((timeout_us & 63UL) == 0UL) OWI_KickWdt();
if (R_TAU1_Channel5_CaptureOverflowed()) break;
if (R_TAU1_Channel5_GetLowWidthTicks(low_ticks))
{
return 1U;
}
if (R_TAU1_Channel5_CaptureOverflowed())
{
break;
}
/* This delay is only a timeout yield; pulse timing is captured by TAU1. */
delay_us(1U);
}
if (!g_owi_timeout_latched)
{
g_capture_error = R_TAU1_Channel5_CaptureOverflowed() ? 2U : 1U;
g_owi_timeout_latched = 1U;
g_owi_last_timeout_byte_index = byte_index;
g_owi_last_timeout_bit_index = bit_index;
}
return 0U;
}
static uint32_t OWI_CaptureFindThreshold(const uint32_t *widths,
uint8_t width_count)
{
uint32_t sorted[OWI_CAPTURE_SYNC_BITS];
uint32_t max_gap = 0UL;
uint32_t threshold =
((uint32_t)bit_period_us * OWI_TAU1_TICKS_PER_US) / 2UL;
uint32_t gap;
uint32_t temp;
uint8_t i;
uint8_t j;
for (i = 0U; i < width_count; i++) {
sorted[i] = widths[i];
}
for (i = 0U; i < (uint8_t)(width_count - 1U); i++) {
for (j = (uint8_t)(i + 1U); j < width_count; j++) {
if (sorted[j] < sorted[i]) {
temp = sorted[i];
sorted[i] = sorted[j];
sorted[j] = temp;
}
}
}
/* The 0x26 header contains both short and long LOW pulses. The largest
gap separates the two measured clusters without assuming timer scale. */
for (i = 0U; i < (uint8_t)(width_count - 1U); i++) {
gap = sorted[i + 1U] - sorted[i];
if (gap > max_gap) {
max_gap = gap;
threshold = sorted[i] + (gap / 2UL);
}
}
return threshold;
}
static uint8_t OWI_CaptureExpectedHeaderBit(uint8_t header_bit_index)
{
return (uint8_t)((0x26U >> (7U - header_bit_index)) & 0x01U);
}
/* Find a complete header in the bounded startup window. The read-address
release may add a leading capture (observed SYNC=9343: 1|00100110|1000011).
Preserve every bit after the header; never reconstruct a partial header. */
static uint8_t OWI_CaptureFindHeaderEnd(const uint8_t *bits,
uint8_t bit_count,
uint8_t * const header_end)
{
uint8_t start;
uint8_t i;
if (!bits || !header_end || bit_count < 8U ||
bit_count > OWI_CAPTURE_SYNC_BITS) return 0U;
for (start = 0U; start <= (uint8_t)(bit_count - 8U); start++) {
for (i = 0U; i < 8U; i++) {
if (bits[start + i] != OWI_CaptureExpectedHeaderBit(i)) break;
}
if (i == 8U) {
*header_end = (uint8_t)(start + 8U);
return 1U;
}
}
return 0U;
}
static uint8_t OWI_CaptureGetDecodedBit(uint16_t byte_index,
uint8_t bit_index,
uint8_t * const decoded_bit)
{
uint32_t low_ticks;
if (decoded_bit == 0) {
return 0U;
}
if (g_owi_capture_pending_index < g_owi_capture_pending_count) {
*decoded_bit = g_owi_capture_pending_bits[g_owi_capture_pending_index++];
return 1U;
}
if (!OWI_CaptureWaitLowWidth(byte_index, bit_index, &low_ticks)) {
return 0U;
}
*decoded_bit = (low_ticks < g_owi_capture_threshold_ticks) ? 1U : 0U;
return 1U;
}
static uint8_t OWI_ReadByte_Captured(uint16_t byte_index)
{
uint8_t data = 0U;
int b;
uint32_t sync_widths[OWI_CAPTURE_SYNC_BITS];
if (byte_index == 0U)
{
uint8_t sync_bits[OWI_CAPTURE_SYNC_BITS];
uint8_t header_end;
uint8_t i;
for (i = 0U; i < OWI_CAPTURE_SYNC_BITS; i++)
{
OWI_KickWdt();
g_owi_current_read_byte_index = 0U;
g_owi_current_read_bit_index = i;
if (!OWI_CaptureWaitLowWidth(0U, i, &sync_widths[i]))
{
return 0U;
}
}
g_owi_capture_threshold_ticks =
OWI_CaptureFindThreshold(sync_widths, OWI_CAPTURE_SYNC_BITS);
for (i = 0U; i < OWI_CAPTURE_SYNC_BITS; i++) {
sync_bits[i] =
(sync_widths[i] < g_owi_capture_threshold_ticks) ? 1U : 0U;
}
g_capture_sync = 0U;
for (i = 0U; i < OWI_CAPTURE_SYNC_BITS; i++) {
g_capture_sync = (uint16_t)((g_capture_sync << 1) | sync_bits[i]);
}
if (!OWI_CaptureFindHeaderEnd(sync_bits,
OWI_CAPTURE_SYNC_BITS,
&header_end)) {
if (!g_owi_timeout_latched) {
g_owi_timeout_latched = 1U;
g_capture_error = 3U;
g_owi_last_timeout_byte_index = 0U;
g_owi_last_timeout_bit_index = 0U;
}
return 0U;
}
g_owi_capture_pending_index = 0U;
g_owi_capture_pending_count =
(uint8_t)(OWI_CAPTURE_SYNC_BITS - header_end);
for (i = 0U; i < g_owi_capture_pending_count; i++) {
g_owi_capture_pending_bits[i] = sync_bits[header_end + i];
}
return 0x26U;
}
for (b = 7; b >= 0; b--)
{
uint8_t bit_index = (uint8_t)(7 - b);
uint8_t bit;
g_owi_current_read_byte_index = byte_index;
g_owi_current_read_bit_index = bit_index;
if (!OWI_CaptureGetDecodedBit(byte_index, bit_index, &bit))
{
break;
}
if (bit)
{
data |= (uint8_t)(1U << b);
}
}
return data;
}
#endif
void OWI_SecureStop(void)
{
int i;
@ -381,16 +667,51 @@ void OWI_ReadBytesRaw(int length, uint8_t id, owi_io_result_t *r)
length = max_len;
}
r->read_len = (uint16_t)length;
r->read_len = 0U;
OWI_ClearTimeout();
is_long_read = (length >= 119) ? 1u : 0u;
OWI_KickWdt();
#if OWI_USE_TAU1_CAPTURE
if (length == 127) OWI_CapturePrepare();
#endif
OWI_SecureStop();
#if OWI_USE_TAU1_CAPTURE
if (length == 127) OWI_WriteCapturedReadAddress((uint8_t)((id << 1) | 1u));
else
#endif
OWI_WriteByte((uint8_t)((id << 1) | 1u));
/* 기존 잘 되던 값 유지 */
#if OWI_USE_TAU1_CAPTURE
if (length == 127) {
for (i = 0; i < length; i++) {
uint8_t value;
OWI_KickWdt();
g_trace_stage = 8U;
g_trace_byte = (uint16_t)i;
value = OWI_ReadByte_Captured((uint16_t)i);
if (R_TAU1_Channel5_CaptureOverflowed() && !OWI_HasTimeout()) {
g_owi_timeout_latched = 1U;
g_owi_last_timeout_byte_index = (uint16_t)i;
g_owi_last_timeout_bit_index = 0xFFU;
g_capture_error = 2U;
}
if (OWI_HasTimeout()) {
owi_result_latch_timeout(r);
break;
}
r->data[r->read_len++] = value;
}
g_trace_stage = 9U;
OWI_CaptureEnd();
OWI_StopRead();
OWI_KickWdt();
return;
}
#endif
delay_us(100u);
OWI_KickWdt();
@ -420,6 +741,7 @@ void OWI_ReadBytesRaw(int length, uint8_t id, owi_io_result_t *r)
owi_result_latch_timeout(r);
break;
}
r->read_len++;
}
OWI_StopRead();

2
owi.h

@ -58,6 +58,8 @@ void OWI_T_CommandModeRaw(const uint8_t *tx_data, uint8_t tx_len, uint8_t id, ow
void OWI_CommandModeRaw (const uint8_t *tx_data, uint8_t tx_len, uint8_t id, owi_io_result_t *r);
void OWI_ReadBytesRaw (int length, uint8_t id, owi_io_result_t *r);
uint8_t OWI_GetCaptureError(void);
uint16_t OWI_GetCaptureSync(void);
uint8_t OWI_HasTimeout(void);
void OWI_ClearTimeout(void);
uint16_t OWI_GetLastTimeoutByteIndex(void);

2
r_cg_cgc.c

@ -23,7 +23,7 @@
* Device(s) : R5F10PPJ
* Tool-Chain : CCRL
* Description : This file implements device driver for CGC module.
* Creation Date: 2026-06-08
* Creation Date: 2026-09-15
***********************************************************************************************************************/
/***********************************************************************************************************************

9
r_cg_cgc.h

@ -23,7 +23,7 @@
* Device(s) : R5F10PPJ
* Tool-Chain : CCRL
* Description : This file implements device driver for CGC module.
* Creation Date: 2026-06-08
* Creation Date: 2026-09-15
***********************************************************************************************************************/
#ifndef CGC_H
@ -223,5 +223,12 @@ void R_CGC_Create(void);
void R_CGC_Get_ResetSource(void);
/* Start user code for function. Do not edit comment generated here */
extern volatile __near uint8_t g_boot_reset_flags;
extern volatile __near uint16_t g_trace_magic;
extern volatile __near uint8_t g_trace_stage;
extern volatile __near uint16_t g_trace_byte;
extern volatile __near uint16_t g_trace_stack_low;
extern volatile __near uint8_t g_trace_isr;
void NVM_TraceStack(void);
/* End user code. Do not edit comment generated here */
#endif

24
r_cg_cgc_user.c

@ -23,7 +23,7 @@
* Device(s) : R5F10PPJ
* Tool-Chain : CCRL
* Description : This file implements device driver for CGC module.
* Creation Date: 2026-06-08
* Creation Date: 2026-09-15
***********************************************************************************************************************/
/***********************************************************************************************************************
@ -45,6 +45,17 @@ Pragma directive
Global variables and functions
***********************************************************************************************************************/
/* Start user code for global. Do not edit comment generated here */
/* hdwinit runs before C RAM initialization. This section is deliberately
outside .bss/.data initialized by this project's cstart.asm. */
#pragma section bss RESET_DIAG
volatile __near uint8_t g_boot_reset_flags;
volatile __near uint16_t g_trace_magic;
volatile __near uint8_t g_trace_stage;
volatile __near uint16_t g_trace_byte;
volatile __near uint16_t g_trace_stack_low;
volatile __near uint8_t g_trace_isr;
#pragma section
/* End user code. Do not edit comment generated here */
/***********************************************************************************************************************
@ -57,8 +68,19 @@ void R_CGC_Get_ResetSource(void)
{
uint8_t reset_flag = RESF;
/* Start user code. Do not edit comment generated here */
g_boot_reset_flags = reset_flag;
/* End user code. Do not edit comment generated here */
}
/* Start user code for adding. Do not edit comment generated here */
/* Single foreground owner; the ISR only sets its separate marker. The address
of this local is a stack-position sample, not an exhaustive high-water mark. */
void NVM_TraceStack(void)
{
volatile uint8_t sample;
uint16_t address = (uint16_t)&sample;
if (g_trace_magic == 0x4352U && address < g_trace_stack_low)
g_trace_stack_low = address;
}
/* End user code. Do not edit comment generated here */

2
r_cg_macrodriver.h

@ -23,7 +23,7 @@
* Device(s) : R5F10PPJ
* Tool-Chain : CCRL
* Description : This file implements general head file.
* Creation Date: 2026-06-08
* Creation Date: 2026-09-15
***********************************************************************************************************************/
#ifndef STATUS_H

7
r_cg_port.c

@ -23,7 +23,7 @@
* Device(s) : R5F10PPJ
* Tool-Chain : CCRL
* Description : This file implements device driver for PORT module.
* Creation Date: 2026-06-08
* Creation Date: 2026-09-15
***********************************************************************************************************************/
/***********************************************************************************************************************
@ -57,19 +57,14 @@ void R_PORT_Create(void)
{
P4 = _00_Pn7_OUTPUT_0;
P6 = _00_Pn4_OUTPUT_0 | _00_Pn5_OUTPUT_0;
P7 = _00_Pn0_OUTPUT_0;
P14 = _00_Pn0_OUTPUT_0;
P15 = _00_Pn2_OUTPUT_0 | _00_Pn3_OUTPUT_0 | _00_Pn4_OUTPUT_0 | _00_Pn5_OUTPUT_0 | _00_Pn7_OUTPUT_0;
POM6 = _04_POMn2_NCH_ON | _08_POMn3_NCH_ON;
PMC7 = _00_PMCn0_DI_ON | _02_PMCn1_NOT_USE | _04_PMCn2_NOT_USE | _08_PMCn3_NOT_USE | _10_PMCn4_NOT_USE |
_E0_PMC7_DEFAULT;
PSRSEL = _00_PSR140_NORMAL;
PM4 = _01_PMn0_NOT_USE | _02_PMn1_NOT_USE | _04_PMn2_NOT_USE | _08_PMn3_NOT_USE | _10_PMn4_NOT_USE |
_20_PMn5_NOT_USE | _40_PMn6_NOT_USE | _00_PMn7_MODE_OUTPUT;
PM6 = _01_PMn0_NOT_USE | _02_PMn1_NOT_USE | _04_PMn2_NOT_USE | _08_PMn3_NOT_USE | _00_PMn4_MODE_OUTPUT |
_00_PMn5_MODE_OUTPUT | _40_PMn6_NOT_USE | _80_PMn7_MODE_INPUT;
PM7 = _00_PMn0_MODE_OUTPUT | _02_PMn1_NOT_USE | _04_PMn2_NOT_USE | _08_PMn3_NOT_USE | _10_PMn4_NOT_USE |
_20_PMn5_NOT_USE | _40_PMn6_NOT_USE | _80_PMn7_NOT_USE;
PM14 = _00_PMn0_MODE_OUTPUT | _FE_PM14_DEFAULT;
PM15 = _01_PMn0_MODE_INPUT | _02_PMn1_NOT_USE | _00_PMn2_MODE_OUTPUT | _00_PMn3_MODE_OUTPUT | _00_PMn4_MODE_OUTPUT |
_00_PMn5_MODE_OUTPUT | _40_PMn6_MODE_INPUT | _00_PMn7_MODE_OUTPUT;

2
r_cg_port.h

@ -23,7 +23,7 @@
* Device(s) : R5F10PPJ
* Tool-Chain : CCRL
* Description : This file implements device driver for PORT module.
* Creation Date: 2026-06-08
* Creation Date: 2026-09-15
***********************************************************************************************************************/
#ifndef PORT_H

2
r_cg_port_user.c

@ -23,7 +23,7 @@
* Device(s) : R5F10PPJ
* Tool-Chain : CCRL
* Description : This file implements device driver for PORT module.
* Creation Date: 2026-06-08
* Creation Date: 2026-09-15
***********************************************************************************************************************/
/***********************************************************************************************************************

2
r_cg_serial.c

@ -23,7 +23,7 @@
* Device(s) : R5F10PPJ
* Tool-Chain : CCRL
* Description : This file implements device driver for Serial module.
* Creation Date: 2026-06-08
* Creation Date: 2026-09-15
***********************************************************************************************************************/
/***********************************************************************************************************************

2
r_cg_serial.h

@ -23,7 +23,7 @@
* Device(s) : R5F10PPJ
* Tool-Chain : CCRL
* Description : This file implements device driver for Serial module.
* Creation Date: 2026-06-08
* Creation Date: 2026-09-15
***********************************************************************************************************************/
#ifndef SERIAL_H

2
r_cg_serial_user.c

@ -23,7 +23,7 @@
* Device(s) : R5F10PPJ
* Tool-Chain : CCRL
* Description : This file implements device driver for Serial module.
* Creation Date: 2026-06-08
* Creation Date: 2026-09-15
***********************************************************************************************************************/
/***********************************************************************************************************************

157
r_cg_timer.c

@ -0,0 +1,157 @@
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products.
* No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY
* LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT,
* INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR
* ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability
* of this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2012, 2021 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : r_cg_timer.c
* Version : CodeGenerator for RL78/F14 V2.03.07.02 [08 Nov 2021]
* Device(s) : R5F10PPJ
* Tool-Chain : CCRL
* Description : This file implements device driver for TAU module.
* Creation Date: 2026-09-15
***********************************************************************************************************************/
/***********************************************************************************************************************
Includes
***********************************************************************************************************************/
#include "r_cg_macrodriver.h"
#include "r_cg_timer.h"
/* Start user code for include. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
#include "r_cg_userdefine.h"
/***********************************************************************************************************************
Pragma directive
***********************************************************************************************************************/
/* Start user code for pragma. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
/***********************************************************************************************************************
Global variables and functions
***********************************************************************************************************************/
/* For TAU1_ch5 pulse measurement */
extern volatile uint32_t g_tau1_ch5_width;
/* Start user code for global. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
/***********************************************************************************************************************
* Function Name: R_TAU1_Create
* Description : This function initializes the TAU1 module.
* Arguments : None
* Return Value : None
***********************************************************************************************************************/
void R_TAU1_Create(void)
{
TAU1EN = 1U; /* supplies input clock */
TPS1 = _0000_TAU_CKM0_FCLK_0 | _0000_TAU_CKM1_FCLK_0 | _0000_TAU_CKM2_FCLK_0 | _0000_TAU_CKM3_FCLK_0;
/* Stop all channels */
TT1 = _0001_TAU_CH0_STOP_TRG_ON | _0002_TAU_CH1_STOP_TRG_ON | _0004_TAU_CH2_STOP_TRG_ON |
_0008_TAU_CH3_STOP_TRG_ON | _0010_TAU_CH4_STOP_TRG_ON | _0020_TAU_CH5_STOP_TRG_ON |
_0040_TAU_CH6_STOP_TRG_ON | _0080_TAU_CH7_STOP_TRG_ON | _0200_TAU_CH1_H8_STOP_TRG_ON |
_0800_TAU_CH3_H8_STOP_TRG_ON;
PWMDLY2 = _0000_TAU_PWM_DELAY_CLEAR; /* clear PWM output delay */
/* Mask channel 0 interrupt */
TMMK10 = 1U; /* disable INTTM10 interrupt */
TMIF10 = 0U; /* clear INTTM10 interrupt flag */
/* Mask channel 1 interrupt */
TMMK11 = 1U; /* disable INTTM11 interrupt */
TMIF11 = 0U; /* clear INTTM11 interrupt flag */
/* Mask channel 1 higher 8 bits interrupt */
TMMK11H = 1U; /* disable INTTM11H interrupt */
TMIF11H = 0U; /* clear INTTM11H interrupt flag */
/* Mask channel 2 interrupt */
TMMK12 = 1U; /* disable INTTM12 interrupt */
TMIF12 = 0U; /* clear INTTM12 interrupt flag */
/* Mask channel 3 interrupt */
TMMK13 = 1U; /* disable INTTM13 interrupt */
TMIF13 = 0U; /* clear INTTM13 interrupt flag */
/* Mask channel 3 higher 8 bits interrupt */
TMMK13H = 1U; /* disable INTTM13H interrupt */
TMIF13H = 0U; /* clear INTTM13H interrupt flag */
/* Mask channel 4 interrupt */
TMMK14 = 1U; /* disable INTTM14 interrupt */
TMIF14 = 0U; /* clear INTTM14 interrupt flag */
/* Mask channel 5 interrupt */
TMMK15 = 1U; /* disable INTTM15 interrupt */
TMIF15 = 0U; /* clear INTTM15 interrupt flag */
/* Mask channel 6 interrupt */
TMMK16 = 1U; /* disable INTTM16 interrupt */
TMIF16 = 0U; /* clear INTTM16 interrupt flag */
/* Mask channel 7 interrupt */
TMMK17 = 1U; /* disable INTTM17 interrupt */
TMIF17 = 0U; /* clear INTTM17 interrupt flag */
/* Set INTTM15 high priority */
TMPR115 = 0U;
TMPR015 = 0U;
/* Channel 5 is used to measure input pulse interval */
TMR15 = _0000_TAU_CLOCK_SELECT_CKM0 | _0000_TAU_CLOCK_MODE_CKS | _0000_TAU_COMBINATION_SLAVE |
_0100_TAU_TRIGGER_TIMN_VALID | _0080_TAU_TIMN_EDGE_BOTH_LOW | _0004_TAU_MODE_CAPTURE |
_0000_TAU_START_INT_UNUSED;
TOM1 &= ~_0020_TAU_CH5_OUTPUT_COMBIN;
TOL1 &= ~_0020_TAU_CH5_OUTPUT_LEVEL_L;
TO1 &= ~_0020_TAU_CH5_OUTPUT_VALUE_1;
TOE1 &= ~_0020_TAU_CH5_OUTPUT_ENABLE;
NFEN2 |= _20_TAU_CH5_NOISE_ON; /* enable using noise filter of TI15 pin input signal */
/* Set TI15 pin */
PIM7 &= 0xFEU;
PMC7 &= 0xFEU;
PM7 |= 0x01U;
}
/***********************************************************************************************************************
* Function Name: R_TAU1_Channel5_Start
* Description : This function starts TAU1 channel 5 counter.
* Arguments : None
* Return Value : None
***********************************************************************************************************************/
void R_TAU1_Channel5_Start(void)
{
TMIF15 = 0U; /* clear INTTM15 interrupt flag */
TMMK15 = 0U; /* enable INTTM15 interrupt */
TS1 |= _0020_TAU_CH5_START_TRG_ON;
}
/***********************************************************************************************************************
* Function Name: R_TAU1_Channel5_Stop
* Description : This function stops TAU1 channel 5 counter.
* Arguments : None
* Return Value : None
***********************************************************************************************************************/
void R_TAU1_Channel5_Stop(void)
{
TT1 |= _0020_TAU_CH5_STOP_TRG_ON;
/* Mask channel 5 interrupt */
TMMK15 = 1U; /* disable INTTM15 interrupt */
TMIF15 = 0U; /* clear INTTM15 interrupt flag */
}
/***********************************************************************************************************************
* Function Name: R_TAU1_Channel5_Get_PulseWidth
* Description : This function measures TAU1 channel 5 input pulse width.
* Arguments : width -
* the address where to write the input pulse width
* Return Value : None
***********************************************************************************************************************/
void R_TAU1_Channel5_Get_PulseWidth(uint32_t * const width)
{
/* For channel 5 pulse measurement */
*width = g_tau1_ch5_width;
}
/* Start user code for adding. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */

1048
r_cg_timer.h

File diff suppressed because it is too large

133
r_cg_timer_user.c

@ -0,0 +1,133 @@
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products.
* No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY
* LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT,
* INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR
* ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability
* of this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2012, 2021 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : r_cg_timer_user.c
* Version : CodeGenerator for RL78/F14 V2.03.07.02 [08 Nov 2021]
* Device(s) : R5F10PPJ
* Tool-Chain : CCRL
* Description : This file implements device driver for TAU module.
* Creation Date: 2026-09-15
***********************************************************************************************************************/
/***********************************************************************************************************************
Includes
***********************************************************************************************************************/
#include "r_cg_macrodriver.h"
#include "r_cg_timer.h"
#include "r_cg_cgc.h"
/* Start user code for include. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
#include "r_cg_userdefine.h"
/***********************************************************************************************************************
Pragma directive
***********************************************************************************************************************/
#pragma interrupt r_tau1_channel5_interrupt(vect=INTTM15)
/* Start user code for pragma. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
/***********************************************************************************************************************
Global variables and functions
***********************************************************************************************************************/
/* For TAU1_ch5 pulse measurement */
volatile uint32_t g_tau1_ch5_width = 0UL;
/* Start user code for global. Do not edit comment generated here */
#define TAU1_CH5_CAPTURE_QUEUE_SIZE (16U)
#define TAU1_CH5_CAPTURE_QUEUE_MASK (TAU1_CH5_CAPTURE_QUEUE_SIZE - 1U)
static volatile uint32_t g_tau1_ch5_low_ticks[TAU1_CH5_CAPTURE_QUEUE_SIZE];
static volatile uint8_t g_tau1_ch5_capture_head = 0U;
static volatile uint8_t g_tau1_ch5_capture_tail = 0U;
static volatile uint8_t g_tau1_ch5_capture_overflow = 0U;
/* End user code. Do not edit comment generated here */
/***********************************************************************************************************************
* Function Name: r_tau1_channel5_interrupt
* Description : This function is INTTM15 interrupt service routine.
* Arguments : None
* Return Value : None
***********************************************************************************************************************/
static void __near r_tau1_channel5_interrupt(void)
{
if ((TSR15 & _0001_TAU_OVERFLOW_OCCURS) == 1U) /* overflow occurs */
{
g_tau1_ch5_width = ((uint32_t)TDR15 + 1UL) + 0x10000U;
}
else
{
g_tau1_ch5_width = ((uint32_t)TDR15 + 1UL);
}
/* Start user code. Do not edit comment generated here */
g_trace_isr = 1U;
/* A rising edge ends a LOW pulse. Queue only LOW widths for the OWI decoder. */
if ((P7 & 0x01U) != 0U)
{
uint8_t next = (uint8_t)((g_tau1_ch5_capture_head + 1U) & TAU1_CH5_CAPTURE_QUEUE_MASK);
if (next != g_tau1_ch5_capture_tail)
{
g_tau1_ch5_low_ticks[g_tau1_ch5_capture_head] = g_tau1_ch5_width;
g_tau1_ch5_capture_head = next;
}
else
{
g_tau1_ch5_capture_overflow = 1U;
}
}
g_trace_isr = 0U;
/* End user code. Do not edit comment generated here */
}
/* Start user code for adding. Do not edit comment generated here */
/* Call only while channel 5 is stopped. */
void R_TAU1_Channel5_CaptureReset(void)
{
g_tau1_ch5_capture_head = 0U;
g_tau1_ch5_capture_tail = 0U;
g_tau1_ch5_capture_overflow = 0U;
g_tau1_ch5_width = 0UL;
}
uint8_t R_TAU1_Channel5_GetLowWidthTicks(uint32_t * const ticks)
{
uint8_t available = 0U;
if (ticks == 0)
{
return 0U;
}
if (g_tau1_ch5_capture_tail != g_tau1_ch5_capture_head)
{
*ticks = g_tau1_ch5_low_ticks[g_tau1_ch5_capture_tail];
g_tau1_ch5_capture_tail =
(uint8_t)((g_tau1_ch5_capture_tail + 1U) & TAU1_CH5_CAPTURE_QUEUE_MASK);
available = 1U;
}
return available;
}
uint8_t R_TAU1_Channel5_CaptureOverflowed(void)
{
return g_tau1_ch5_capture_overflow;
}
/* End user code. Do not edit comment generated here */

2
r_cg_userdefine.h

@ -23,7 +23,7 @@
* Device(s) : R5F10PPJ
* Tool-Chain : CCRL
* Description : This file includes user definition.
* Creation Date: 2026-06-08
* Creation Date: 2026-09-15
***********************************************************************************************************************/
#ifndef _USER_DEF_H

2
r_cg_wdt.c

@ -23,7 +23,7 @@
* Device(s) : R5F10PPJ
* Tool-Chain : CCRL
* Description : This file implements device driver for WDT module.
* Creation Date: 2026-06-08
* Creation Date: 2026-09-15
***********************************************************************************************************************/
/***********************************************************************************************************************

2
r_cg_wdt.h

@ -23,7 +23,7 @@
* Device(s) : R5F10PPJ
* Tool-Chain : CCRL
* Description : This file implements device driver for WDT module.
* Creation Date: 2026-06-08
* Creation Date: 2026-09-15
***********************************************************************************************************************/
#ifndef WDT_H

2
r_cg_wdt_user.c

@ -23,7 +23,7 @@
* Device(s) : R5F10PPJ
* Tool-Chain : CCRL
* Description : This file implements device driver for WDT module.
* Creation Date: 2026-06-08
* Creation Date: 2026-09-15
***********************************************************************************************************************/
/***********************************************************************************************************************

116
r_main.c

@ -23,7 +23,7 @@
* Device(s) : R5F10PPJ
* Tool-Chain : CCRL
* Description : This file implements main function.
* Creation Date: 2026-06-08
* Creation Date: 2026-09-15
***********************************************************************************************************************/
/***********************************************************************************************************************
@ -33,6 +33,8 @@ Includes
#include "r_cg_cgc.h"
#include "r_cg_port.h"
#include "r_cg_serial.h"
#include "r_cg_timer.h"
#include "owi.h"
#include "r_cg_wdt.h"
/* Start user code for include. Do not edit comment generated here */
#include "common.h"
@ -751,7 +753,7 @@ static uint8_t copy_nvm_tail8(const app_owi_result_t *r, uint8_t *tail8)
uint16_t i;
if (!r || !tail8) return 0u;
if (!r->ok || r->timeout || r->read_len < 127u) return 0u;
if (!r->ok || r->timeout || r->read_len != 127u) return 0u;
start = (uint16_t)(r->read_len - 8u);
@ -776,20 +778,47 @@ static void tail8_to_hex16(const uint8_t *tail8, char *out_hex)
out_hex[16] = '\0';
}
/* Retain the last failing NVM stage for a diagnostic printed AFTER reception. */
static uint8_t g_nvm_stage;
static uint16_t g_nvm_rx_len, g_nvm_fail_byte;
static uint8_t g_nvm_fail_bit;
static void nvm_diag_result(uint8_t stage, const app_owi_result_t *r)
{
g_nvm_stage = stage;
g_nvm_rx_len = r->read_len;
g_nvm_fail_byte = r->timeout_byte_index;
g_nvm_fail_bit = r->timeout_bit_index;
}
static void print_nvm_failure(void)
{
char msg[112];
out_print("Fail\r\n");
(void)sprintf(msg, "NVM S=%u RX=%u B=%u b=%u CAP=%u SYNC=%04X\r\n",
(unsigned)g_nvm_stage, (unsigned)g_nvm_rx_len,
(unsigned)g_nvm_fail_byte, (unsigned)g_nvm_fail_bit,
(unsigned)OWI_GetCaptureError(), (unsigned)OWI_GetCaptureSync());
out_print(msg);
}
static uint8_t read_connected_nvm_tail8(uint8_t *tail8)
{
app_owi_result_t r_write_nvm;
app_owi_result_t r_read_nvm;
app_owi_result_t result;
static const uint8_t nvm_cmd[3] = { 0x26u, 0x00u, 0x3Eu };
if (!tail8) return 0u;
r_write_nvm = app_owi_write_basic(0x28u, nvm_cmd, 3u);
if (!r_write_nvm.ok || r_write_nvm.timeout) return 0u;
g_trace_stage = 5U;
NVM_TraceStack();
result = app_owi_write_basic(0x28u, nvm_cmd, 3u);
nvm_diag_result(5U, &result);
if (!result.ok || result.timeout) return 0u;
delay_us(2000u);
r_read_nvm = do_stable_owi_read(0x28u, 127u);
if (!copy_nvm_tail8(&r_read_nvm, tail8)) return 0u;
g_trace_stage = 6U;
NVM_TraceStack();
result = do_stable_owi_read(0x28u, 127u);
nvm_diag_result(6U, &result);
if (!copy_nvm_tail8(&result, tail8)) return 0u;
return 1u;
}
@ -799,41 +828,59 @@ static uint8_t read_connected_nvm_last16(uint8_t ch,
uint8_t check_on,
char *out_hex)
{
app_owi_result_t r_write1;
app_owi_result_t r_read2;
app_owi_result_t r_write3;
app_owi_result_t r_read3;
app_owi_result_t result;
static const uint8_t connect_cmd[3] = { 0x72u, 0x7Eu, 0xA9u };
static const uint8_t expect_7272[2] = { 0x72u, 0x72u };
static const uint8_t expect_7c[3] = { 0x7Cu, 0x78u, 0x01u };
uint8_t cmd_7c = 0x7Cu;
uint8_t tail8[8];
g_nvm_stage = 0U;
g_nvm_rx_len = 0U;
g_nvm_fail_byte = 0xFFFFU;
g_nvm_fail_bit = 0xFFU;
if (!out_hex) return 0u;
if (ch < 1u || ch > 20u) return 0u;
g_trace_stage = 1U;
g_trace_byte = 0U;
g_trace_stack_low = 0xFFFFU;
NVM_TraceStack();
Cal_Init();
Gate_SetByNum(ch, hash_on, anaout_on, check_on);
GateCtrl_SelectChannel(ch);
r_write1 = app_owi_write_t_basic(0x28u, connect_cmd, 3u);
if (!r_write1.ok || r_write1.timeout) return 0u;
g_trace_stage = 1U;
NVM_TraceStack();
result = app_owi_write_t_basic(0x28u, connect_cmd, 3u);
nvm_diag_result(1U, &result);
if (!result.ok || result.timeout) return 0u;
delay_us(2000u);
r_read2 = app_owi_read_basic(0x28u, 2);
if (!r_read2.ok || r_read2.timeout || r_read2.read_len < 2u) return 0u;
if (memcmp(r_read2.data, expect_7272, 2u) != 0) return 0u;
r_write3 = app_owi_write_t_basic(0x28u, &cmd_7c, 1u);
if (!r_write3.ok || r_write3.timeout) return 0u;
g_trace_stage = 2U;
NVM_TraceStack();
result = app_owi_read_basic(0x28u, 2);
nvm_diag_result(2U, &result);
if (!result.ok || result.timeout || result.read_len < 2u) return 0u;
if (memcmp(result.data, expect_7272, 2u) != 0) return 0u;
g_trace_stage = 3U;
NVM_TraceStack();
result = app_owi_write_t_basic(0x28u, &cmd_7c, 1u);
nvm_diag_result(3U, &result);
if (!result.ok || result.timeout) return 0u;
delay_us(2000u);
r_read3 = app_owi_read_basic(0x28u, 3);
if (!r_read3.ok || r_read3.timeout || r_read3.read_len < 3u) return 0u;
if (memcmp(r_read3.data, expect_7c, 3u) != 0) return 0u;
g_trace_stage = 4U;
NVM_TraceStack();
result = app_owi_read_basic(0x28u, 3);
nvm_diag_result(4U, &result);
if (!result.ok || result.timeout || result.read_len < 3u) return 0u;
if (memcmp(result.data, expect_7c, 3u) != 0) return 0u;
if (!read_connected_nvm_tail8(tail8)) return 0u;
g_trace_stage = 10U;
tail8_to_hex16(tail8, out_hex);
return 1u;
}
@ -1002,7 +1049,7 @@ static int execute_direct_read_sequence(const app_job_t *job)
(void)sprintf(out, "%s\r\n", nvm_hex);
out_print(out);
} else {
out_print("Fail\r\n");
print_nvm_failure();
}
reset_channel_gate_defaults(job->channel);
send_end_response();
@ -1040,7 +1087,7 @@ static void do_nvm_read_after_gauge(void)
out_print(nvm_hex);
out_print("\r\n");
} else {
out_print("Fail\r\n");
print_nvm_failure();
}
}
@ -1282,6 +1329,7 @@ static void app_job_tick(void)
if (!execute_owi_service_from_job(&g_runtime.job)) {
out_print("Err:job_exec\r\n");
}
g_trace_stage = 0U;
runtime_reset();
return;
@ -1334,6 +1382,24 @@ void main(void)
Cal_Init();
uart1_send_string_safe("BOOT single-mode\r\n");
{
char boot_diag[40];
(void)sprintf(boot_diag, "BOOT capture-r5 RESF=%02X\r\n",
(unsigned)g_boot_reset_flags);
uart1_send_string_safe(boot_diag);
}
if (g_trace_magic == 0x4352U) {
char trace_diag[80];
(void)sprintf(trace_diag, "PREV S=%u B=%u STACK=%04X ISR=%u\r\n",
(unsigned)g_trace_stage, (unsigned)g_trace_byte,
(unsigned)g_trace_stack_low, (unsigned)g_trace_isr);
uart1_send_string_safe(trace_diag);
}
g_trace_magic = 0x4352U;
g_trace_stage = 0U;
g_trace_byte = 0U;
g_trace_stack_low = 0xFFFFU;
g_trace_isr = 0U;
uart_rx_done = 0;
uart_rx_index = 0;

4
r_systeminit.c

@ -23,7 +23,7 @@
* Device(s) : R5F10PPJ
* Tool-Chain : CCRL
* Description : This file implements system initializing function.
* Creation Date: 2026-06-08
* Creation Date: 2026-09-15
***********************************************************************************************************************/
/***********************************************************************************************************************
@ -33,6 +33,7 @@ Includes
#include "r_cg_cgc.h"
#include "r_cg_port.h"
#include "r_cg_serial.h"
#include "r_cg_timer.h"
#include "r_cg_wdt.h"
/* Start user code for include. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
@ -74,6 +75,7 @@ void R_Systeminit(void)
R_SAU0_Create();
R_SAU1_Create();
R_IICA0_Create();
R_TAU1_Create();
R_WDT_Create();
/* Set invalid memory access detection control */

483
tmp/app_owi_service.asm

@ -0,0 +1,483 @@
#CC-RL Compiler RL78 Assembler Source
#@ CC-RL Version : V1.15.00 [06 Dec 2024]
#@ Commmand :
#@ -cpu=S3
#@ -S
#@ -Olite
#@ -I .
#@ -asm_path=tmp
#@ r_main.c
#@ owi.c
#@ app_owi_service.c
#@ compiled at Tue Sep 15 15:24:24 2026
.EXTERN _memset
.PUBLIC _app_owi_read_basic
.EXTERN _R_WDT_Restart
.EXTERN _OWI_ReadBytesRaw
.EXTERN _delay_us
.PUBLIC _app_owi_write_basic
.EXTERN _OWI_CommandModeRaw
.PUBLIC _app_owi_write_t_basic
.EXTERN _OWI_T_CommandModeRaw
.SECTION .textf,TEXTF
.TYPE _app_owi_from_raw@1,function,.LFE1-_app_owi_from_raw@1
_app_owi_from_raw@1:
.STACK _app_owi_from_raw@1 = 338
subw sp, #0xFE
subw sp, #0x4E
movw [sp+0x02], ax
pop ax
push bc
movw de, #0x0148
clrw bc
movw ax, sp
addw ax, #0x0004
call !!_memset
movw ax, [sp+0x00]
or a, x
bz $.BB@LABEL@1_2
.BB@LABEL@1_1: ; entry.bb6_crit_edge
oneb a
br $.BB@LABEL@1_3
.BB@LABEL@1_2: ; bb5
clrb a
.BB@LABEL@1_3: ; bb6
cmp0 a
bnz $.BB@LABEL@1_5
.BB@LABEL@1_4: ; if_then_bb
mov [sp+0x04], #0x00
br $.BB@LABEL@1_9
.BB@LABEL@1_5: ; if_break_bb
pop de
push de
mov a, [de]
mov [sp+0x04], a
mov a, [de+0x01]
mov [sp+0x05], a
movw ax, [de+0x02]
movw [sp+0x06], ax
pop bc
push bc
movw ax, 0x0144[bc]
push bc
movw bc, sp
movw 0x014A[bc], ax
pop bc
mov a, 0x0146[bc]
movw bc, sp
mov 0x014A[bc], a
clrw bc
pop hl
push hl
br $.BB@LABEL@1_7
.BB@LABEL@1_6: ; bb33
movw ax, sp
addw ax, #0x0004
addw ax, bc
addw ax, #0x0004
movw [sp+0x00], ax
movw ax, hl
addw ax, bc
addw ax, #0x0004
movw de, ax
mov a, [de]
mov d, a
movw ax, [sp+0x00]
xchw ax, de
mov [de], a
incw bc
.BB@LABEL@1_7: ; bb48
movw ax, bc
cmpw ax, [hl+0x02]
bnc $.BB@LABEL@1_9
.BB@LABEL@1_8: ; bb48
cmpw ax, #0x0140
bc $.BB@LABEL@1_6
.BB@LABEL@1_9: ; bb67
movw ax, sp
addw ax, #0x0004
movw bc, ax
movw ax, [sp+0x02]
movw de, #0x0148
call !!_memcpy
addw sp, #0xFE
addw sp, #0x4E
ret
.LFE1:
.TYPE _is_long_owi_read@1,function,.LFE2-_is_long_owi_read@1
_is_long_owi_read@1:
.STACK _is_long_owi_read@1 = 4
cmpw ax, #0x007F
bz $.BB@LABEL@2_2
.BB@LABEL@2_1: ; entry
clrb b
br $.BB@LABEL@2_3
.BB@LABEL@2_2: ; entry
oneb b
.BB@LABEL@2_3: ; entry
cmpw ax, #0x0077
bz $.BB@LABEL@2_5
.BB@LABEL@2_4: ; entry
clrb a
br $.BB@LABEL@2_6
.BB@LABEL@2_5: ; entry
oneb a
.BB@LABEL@2_6: ; entry
or a, b
ret
.LFE2:
.TYPE _looks_bad_tail@1,function,.LFE3-_looks_bad_tail@1
_looks_bad_tail@1:
.STACK _looks_bad_tail@1 = 8
subw sp, #0x04
cmpw ax, #0x0000
bnz $.BB@LABEL@3_2
.BB@LABEL@3_1: ; entry.bb81_crit_edge
oneb a
br $.BB@LABEL@3_15
.BB@LABEL@3_2: ; if_break_bb
movw hl, ax
movw ax, [hl+0x02]
movw de, ax
cmpw ax, #0x0018
bc $.BB@LABEL@3_1
.BB@LABEL@3_3: ; if_break_bb17
clrb b
mov a, b
mov [sp+0x03], a
movw ax, de
addw ax, #0xFFE8
movw [sp+0x00], ax
mov a, b
mov [sp+0x02], a
br $.BB@LABEL@3_13
.BB@LABEL@3_4: ; bb22
movw ax, [sp+0x00]
movw bc, ax
addw ax, hl
addw ax, #0x0004
movw de, ax
mov a, [de]
mov x, a
cmp0 x
bz $.BB@LABEL@3_6
.BB@LABEL@3_5: ; bb22.if_break_bb38_crit_edge
clrb a
br $.BB@LABEL@3_7
.BB@LABEL@3_6: ; if_then_bb35
mov a, [sp+0x02]
inc a
.BB@LABEL@3_7: ; if_then_bb35
mov [sp+0x02], a
inc x
bz $.BB@LABEL@3_9
.BB@LABEL@3_8: ; if_break_bb38.if_break_bb48_crit_edge
clrb a
br $.BB@LABEL@3_10
.BB@LABEL@3_9: ; if_then_bb44
mov a, [sp+0x03]
inc a
.BB@LABEL@3_10: ; if_then_bb44
mov [sp+0x03], a
mov a, [sp+0x02]
cmp a, #0x08
bnc $.BB@LABEL@3_1
.BB@LABEL@3_11: ; if_break_bb48
mov a, [sp+0x03]
cmp a, #0x08
bnc $.BB@LABEL@3_1
.BB@LABEL@3_12: ; if_break_bb68
incw bc
pop ax
push bc
.BB@LABEL@3_13: ; bb71
movw ax, [sp+0x00]
cmpw ax, [hl+0x02]
bc $.BB@LABEL@3_4
.BB@LABEL@3_14: ; bb71.bb81_crit_edge
clrb a
.BB@LABEL@3_15: ; bb81
addw sp, #0x04
ret
.LFE3:
.TYPE _looks_bad_last_bytes@1,function,.LFE4-_looks_bad_last_bytes@1
_looks_bad_last_bytes@1:
.STACK _looks_bad_last_bytes@1 = 8
subw sp, #0x04
cmpw ax, #0x0000
bz $.BB@LABEL@4_13
.BB@LABEL@4_1: ; if_break_bb
movw de, ax
movw ax, [de+0x02]
cmpw ax, #0x0003
bc $.BB@LABEL@4_13
.BB@LABEL@4_2: ; if_break_bb17
addw ax, #0xFFFD
movw [sp+0x02], ax
oneb a
mov [sp+0x00], a
clrb c
oneb a
mov b, a
br $.BB@LABEL@4_8
.BB@LABEL@4_3: ; bb22
shrw ax, 8+0x00000
addw ax, [hl+0x02]
addw ax, de
addw ax, #0x0004
movw hl, ax
mov a, [hl]
cmp0 a
skz
.BB@LABEL@4_4: ; if_then_bb38
clrb b
.BB@LABEL@4_5: ; if_break_bb39
inc a
bz $.BB@LABEL@4_7
.BB@LABEL@4_6: ; if_then_bb45
clrb a
mov [sp+0x00], a
.BB@LABEL@4_7: ; if_break_bb46
inc c
.BB@LABEL@4_8: ; bb49
movw hl, sp
mov a, c
cmp a, #0x03
bc $.BB@LABEL@4_3
.BB@LABEL@4_9: ; bb55
cmp0 b
bnz $.BB@LABEL@4_13
.BB@LABEL@4_10: ; bb55
mov a, [hl]
cmp0 a
bnz $.BB@LABEL@4_13
.BB@LABEL@4_11: ; bb67
clrb a
.BB@LABEL@4_12: ; bb67
addw sp, #0x04
ret
.BB@LABEL@4_13: ; bb74
oneb a
br $.BB@LABEL@4_12
.LFE4:
.TYPE _ends_with_ff_pair@1,function,.LFE5-_ends_with_ff_pair@1
_ends_with_ff_pair@1:
.STACK _ends_with_ff_pair@1 = 4
cmpw ax, #0x0000
bz $.BB@LABEL@5_5
.BB@LABEL@5_1: ; if_break_bb
movw de, ax
movw ax, [de+0x02]
movw bc, ax
cmpw ax, #0x0002
bc $.BB@LABEL@5_5
.BB@LABEL@5_2: ; if_break_bb17
addw ax, de
addw ax, #0x0002
movw hl, ax
mov a, [hl]
inc a
bnz $.BB@LABEL@5_4
.BB@LABEL@5_3: ; bb32
movw ax, bc
addw ax, de
addw ax, #0x0003
movw de, ax
mov a, [de]
inc a
bz $.BB@LABEL@5_5
.BB@LABEL@5_4: ; bb46
clrb a
ret
.BB@LABEL@5_5: ; bb53
oneb a
ret
.LFE5:
.TYPE _needs_retry_for_long_read@1,function,.LFE6-_needs_retry_for_long_read@1
_needs_retry_for_long_read@1:
.STACK _needs_retry_for_long_read@1 = 8
push bc
push ax
movw ax, bc
call $!_is_long_owi_read@1
cmp0 a
bz $.BB@LABEL@6_9
.BB@LABEL@6_1: ; if_break_bb
movw ax, [sp+0x00]
or a, x
bnz $.BB@LABEL@6_3
.BB@LABEL@6_2: ; if_break_bb.bb88_crit_edge
oneb a
br $.BB@LABEL@6_10
.BB@LABEL@6_3: ; if_break_bb23
pop de
push de
mov a, [de]
cmp0 a
bz $.BB@LABEL@6_2
.BB@LABEL@6_4: ; if_break_bb39
mov a, [de+0x01]
cmp0 a
bnz $.BB@LABEL@6_2
.BB@LABEL@6_5: ; if_break_bb49
pop hl
push hl
movw ax, [sp+0x02]
cmpw ax, [hl+0x02]
bh $.BB@LABEL@6_2
.BB@LABEL@6_6: ; if_break_bb59
movw ax, hl
call $!_looks_bad_tail@1
cmp0 a
bnz $.BB@LABEL@6_2
.BB@LABEL@6_7: ; if_break_bb68
movw ax, [sp+0x00]
call $!_looks_bad_last_bytes@1
cmp0 a
bnz $.BB@LABEL@6_2
.BB@LABEL@6_8: ; if_break_bb77
movw ax, [sp+0x00]
call $!_ends_with_ff_pair@1
cmp0 a
bnz $.BB@LABEL@6_2
.BB@LABEL@6_9: ; if_break_bb86
clrb a
.BB@LABEL@6_10: ; bb88
addw sp, #0x04
ret
.LFE6:
.TYPE _app_owi_read_basic,function,.LFE7-_app_owi_read_basic
_app_owi_read_basic:
.STACK _app_owi_read_basic = 340
subw sp, #0xFE
subw sp, #0x52
movw [sp+0x06], ax
mov a, c
mov [sp+0x02], a
movw ax, de
movw [sp+0x04], ax
call !!_R_WDT_Restart
movw ax, sp
addw ax, #0x0008
movw [sp+0x00], ax
movw de, ax
mov a, [sp+0x02]
mov c, a
movw ax, [sp+0x04]
call !!_OWI_ReadBytesRaw
call !!_R_WDT_Restart
movw ax, [sp+0x04]
movw bc, ax
movw ax, [sp+0x00]
call $!_needs_retry_for_long_read@1
cmp0 a
bz $.BB@LABEL@7_5
.BB@LABEL@7_1: ; if_then_bb
call !!_R_WDT_Restart
clrw bc
movw ax, #0x0BB8
call !!_delay_us
call !!_R_WDT_Restart
movw ax, sp
addw ax, #0x0008
movw [sp+0x00], ax
movw de, ax
mov a, [sp+0x02]
mov c, a
movw ax, [sp+0x04]
call !!_OWI_ReadBytesRaw
call !!_R_WDT_Restart
movw ax, [sp+0x04]
movw bc, ax
movw ax, [sp+0x00]
call $!_needs_retry_for_long_read@1
cmp0 a
bz $.BB@LABEL@7_5
.BB@LABEL@7_2: ; bb
mov a, [sp+0x08]
cmp0 a
bz $.BB@LABEL@7_5
.BB@LABEL@7_3: ; bb25
mov a, [sp+0x09]
cmp0 a
bnz $.BB@LABEL@7_5
.BB@LABEL@7_4: ; if_then_bb45
mov [sp+0x08], #0x00
mov [sp+0x09], #0x01
movw ax, #0xFFFE
movw bc, sp
movw 0x014C[bc], ax
movw bc, sp
mov 0x014E[bc], #0xFE
.BB@LABEL@7_5: ; if_break_bb50
movw ax, sp
addw ax, #0x0008
movw bc, ax
movw ax, [sp+0x06]
call $!_app_owi_from_raw@1
addw sp, #0xFE
addw sp, #0x52
ret
.LFE7:
.TYPE _app_owi_write_basic,function,.LFE8-_app_owi_write_basic
_app_owi_write_basic:
.STACK _app_owi_write_basic = 340
subw sp, #0xFE
subw sp, #0x50
movw [sp+0x04], ax
mov a, c
mov [sp+0x01], a
push de
pop hl
mov a, b
mov [sp+0x00], a
movw ax, sp
addw ax, #0x0006
movw [sp+0x02], ax
movw de, ax
pop bc
push bc
mov a, [sp+0x00]
mov c, a
movw ax, hl
call !!_OWI_CommandModeRaw
movw ax, [sp+0x02]
movw bc, ax
movw ax, [sp+0x04]
call $!_app_owi_from_raw@1
addw sp, #0xFE
addw sp, #0x50
ret
.LFE8:
.TYPE _app_owi_write_t_basic,function,.LFE9-_app_owi_write_t_basic
_app_owi_write_t_basic:
.STACK _app_owi_write_t_basic = 340
subw sp, #0xFE
subw sp, #0x50
movw [sp+0x04], ax
mov a, c
mov [sp+0x01], a
push de
pop hl
mov a, b
mov [sp+0x00], a
movw ax, sp
addw ax, #0x0006
movw [sp+0x02], ax
movw de, ax
pop bc
push bc
mov a, [sp+0x00]
mov c, a
movw ax, hl
call !!_OWI_T_CommandModeRaw
movw ax, [sp+0x02]
movw bc, ax
movw ax, [sp+0x04]
call $!_app_owi_from_raw@1
addw sp, #0xFE
addw sp, #0x50
ret
.LFE9:

75
tmp/capture-r5-build.log

@ -0,0 +1,75 @@
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(18):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(19):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(20):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(25):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(26):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(27):W0520301:Typedef name has already been declared (with same type)
uart.h(11):W0520047:Incompatible redefinition of macro "RAM_BYTES" (declared at line 29 of "owi.h")
i2c.h(8):W0520047:Incompatible redefinition of macro "RAM_BYTES" (declared at line 11 of "uart.h")
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(18):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(19):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(20):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(25):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(26):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(27):W0520301:Typedef name has already been declared (with same type)
i2c.h(8):W0520047:Incompatible redefinition of macro "RAM_BYTES" (declared at line 11 of "uart.h")
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(18):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(19):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(20):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(25):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(26):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(27):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(18):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(19):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(20):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(25):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(26):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(27):W0520301:Typedef name has already been declared (with same type)
i2c.h(8):W0520047:Incompatible redefinition of macro "RAM_BYTES" (declared at line 11 of "uart.h")
i2c.c(128):W0520167:Argument of type "const uint8_t *__near" is incompatible with parameter of type "uint8_t *const __near"
i2c.c(120):W0520177:Variable "uart_buf" was declared but never referenced
i2c.c(121):W0520177:Variable "j" was declared but never referenced
i2c.c(122):W0520177:Variable "rx" was declared but never referenced
i2c.c(173):W0520167:Argument of type "const uint8_t *__near" is incompatible with parameter of type "uint8_t *const __near"
i2c.c(169):W0520177:Variable "uart_buf" was declared but never referenced
i2c.c(170):W0520177:Variable "j" was declared but never referenced
i2c.c(171):W0520177:Variable "rx" was declared but never referenced
i2c.c(221):W0520069:Integer conversion resulted in truncation
i2c.c(227):W0520069:Integer conversion resulted in truncation
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(18):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(19):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(20):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(25):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(26):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(27):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(18):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(19):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(20):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(25):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(26):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(27):W0520301:Typedef name has already been declared (with same type)
gatectrl.c(3):W0520550:Variable "s_ch" was set but never used
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(18):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(19):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(20):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(25):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(26):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(27):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(18):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(19):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(20):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(25):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(26):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(27):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(18):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(19):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(20):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(25):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(26):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(27):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(18):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(19):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(20):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(25):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(26):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(27):W0520301:Typedef name has already been declared (with same type)

8
tmp/capture-r5-stack-build.log

@ -0,0 +1,8 @@
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(18):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(19):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(20):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(25):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(26):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(27):W0520301:Typedef name has already been declared (with same type)
uart.h(11):W0520047:Incompatible redefinition of macro "RAM_BYTES" (declared at line 29 of "owi.h")
i2c.h(8):W0520047:Incompatible redefinition of macro "RAM_BYTES" (declared at line 11 of "uart.h")

1727
tmp/owi.asm

File diff suppressed because it is too large

70
tmp/r_cg_cgc_user.asm

@ -0,0 +1,70 @@
#CC-RL Compiler RL78 Assembler Source
#@ CC-RL Version : V1.15.00 [06 Dec 2024]
#@ Commmand :
#@ -cpu=S3
#@ -S
#@ -Olite
#@ -I .
#@ -asm_path=tmp
#@ r_main.c
#@ r_cg_cgc_user.c
#@ compiled at Tue Sep 15 15:35:58 2026
.PUBLIC _g_boot_reset_flags
.PUBLIC _g_trace_magic
.PUBLIC _g_trace_stage
.PUBLIC _g_trace_byte
.PUBLIC _g_trace_stack_low
.PUBLIC _g_trace_isr
.PUBLIC _R_CGC_Get_ResetSource
.PUBLIC _NVM_TraceStack
.SECTION .textf,TEXTF
.TYPE _R_CGC_Get_ResetSource,function,.LFE1-_R_CGC_Get_ResetSource
_R_CGC_Get_ResetSource:
.STACK _R_CGC_Get_ResetSource = 4
mov a, 0xFFFA8
mov !LOWW(_g_boot_reset_flags), a
ret
.LFE1:
.TYPE _NVM_TraceStack,function,.LFE2-_NVM_TraceStack
_NVM_TraceStack:
.STACK _NVM_TraceStack = 6
push hl
movw ax, sp
movw bc, ax
movw ax, !LOWW(_g_trace_magic)
cmpw ax, #0x4352
bnz $.BB@LABEL@2_3
.BB@LABEL@2_1: ; bb
movw ax, bc
cmpw ax, !LOWW(_g_trace_stack_low)
sknc
.BB@LABEL@2_2: ; if_then_bb
movw !LOWW(_g_trace_stack_low), ax
.BB@LABEL@2_3: ; return
pop ax
ret
.LFE2:
.SECTION RESET_DIAG_n,BSS
.TYPE _g_boot_reset_flags,object,1
_g_boot_reset_flags:
.DS (1)
.ALIGN 2
.TYPE _g_trace_magic,object,2
_g_trace_magic:
.DS (2)
.TYPE _g_trace_stage,object,1
_g_trace_stage:
.DS (1)
.ALIGN 2
.TYPE _g_trace_byte,object,2
_g_trace_byte:
.DS (2)
.ALIGN 2
.TYPE _g_trace_stack_low,object,2
_g_trace_stack_low:
.DS (2)
.TYPE _g_trace_isr,object,1
_g_trace_isr:
.DS (1)

161
tmp/r_cg_timer_user.asm

@ -0,0 +1,161 @@
#CC-RL Compiler RL78 Assembler Source
#@ CC-RL Version : V1.15.00 [06 Dec 2024]
#@ Commmand :
#@ -cpu=S3
#@ -S
#@ -Olite
#@ -I .
#@ -asm_path=tmp
#@ r_cg_timer_user.c
#@ compiled at Tue Sep 15 15:34:42 2026
.PUBLIC _g_tau1_ch5_width
.PUBLIC _R_TAU1_Channel5_CaptureReset
.PUBLIC _R_TAU1_Channel5_GetLowWidthTicks
.PUBLIC _R_TAU1_Channel5_CaptureOverflowed
.SECTION .text,TEXT
_r_tau1_channel5_interrupt@1 .vector 0x006E
.TYPE _r_tau1_channel5_interrupt@1,function,.LFE1-_r_tau1_channel5_interrupt@1
_r_tau1_channel5_interrupt@1:
.STACK _r_tau1_channel5_interrupt@1 = 14
push ax
push bc
push de
push hl
push hl
movw ax, !0x01EA
shrw ax, 0x01
onew ax
bnc $.BB@LABEL@1_4
.BB@LABEL@1_1: ; if_then_bb
addw ax, !0xFF7A
movw bc, ax
clrw ax
sknc
.BB@LABEL@1_2: ; if_then_bb
incw ax
.BB@LABEL@1_3: ; if_then_bb
incw ax
br $.BB@LABEL@1_6
.BB@LABEL@1_4: ; if_else_bb
addw ax, !0xFF7A
movw bc, ax
clrw ax
sknc
.BB@LABEL@1_5: ; if_else_bb
incw ax
.BB@LABEL@1_6: ; if_else_bb
movw !LOWW(_g_tau1_ch5_width+0x00002), ax
movw ax, bc
movw !LOWW(_g_tau1_ch5_width), ax
mov a, 0xFFF07
shrw ax, 8+0x00000
shrw ax, 0x01
bnc $.BB@LABEL@1_10
.BB@LABEL@1_7: ; if_then_bb17
mov a, !LOWW(_g_tau1_ch5_capture_head@2)
inc a
and a, #0x0F
mov [sp+0x00], a
cmp a, !LOWW(_g_tau1_ch5_capture_tail@3)
bz $.BB@LABEL@1_9
.BB@LABEL@1_8: ; if_then_bb30
mov a, !LOWW(_g_tau1_ch5_capture_head@2)
mov x, #0x04
mulu x
addw ax, #LOWW(_g_tau1_ch5_low_ticks@1)
movw de, ax
movw bc, !LOWW(_g_tau1_ch5_width+0x00002)
movw hl, !LOWW(_g_tau1_ch5_width)
movw ax, bc
movw [de+0x02], ax
movw ax, hl
movw [de], ax
mov a, [sp+0x00]
mov !LOWW(_g_tau1_ch5_capture_head@2), a
br $.BB@LABEL@1_10
.BB@LABEL@1_9: ; if_else_bb36
oneb !LOWW(_g_tau1_ch5_capture_overflow@4)
.BB@LABEL@1_10: ; return
pop ax
pop hl
pop de
pop bc
pop ax
reti
.LFE1:
.SECTION .textf,TEXTF
.TYPE _R_TAU1_Channel5_CaptureReset,function,.LFE2-_R_TAU1_Channel5_CaptureReset
_R_TAU1_Channel5_CaptureReset:
.STACK _R_TAU1_Channel5_CaptureReset = 4
clrb !LOWW(_g_tau1_ch5_capture_head@2)
clrb !LOWW(_g_tau1_ch5_capture_tail@3)
clrb !LOWW(_g_tau1_ch5_capture_overflow@4)
clrw ax
movw !LOWW(_g_tau1_ch5_width+0x00002), ax
movw !LOWW(_g_tau1_ch5_width), ax
ret
.LFE2:
.TYPE _R_TAU1_Channel5_GetLowWidthTicks,function,.LFE3-_R_TAU1_Channel5_GetLowWidthTicks
_R_TAU1_Channel5_GetLowWidthTicks:
.STACK _R_TAU1_Channel5_GetLowWidthTicks = 6
push ax
or a, x
bz $.BB@LABEL@3_3
.BB@LABEL@3_1: ; if_break_bb
mov a, !LOWW(_g_tau1_ch5_capture_tail@3)
cmp a, !LOWW(_g_tau1_ch5_capture_head@2)
bz $.BB@LABEL@3_3
.BB@LABEL@3_2: ; if_then_bb11
mov a, !LOWW(_g_tau1_ch5_capture_tail@3)
mov x, #0x04
mulu x
addw ax, #LOWW(_g_tau1_ch5_low_ticks@1)
movw de, ax
movw ax, [de+0x02]
movw bc, ax
movw ax, [de]
movw de, ax
movw ax, [sp+0x00]
xchw ax, de
movw [de], ax
movw ax, bc
movw [de+0x02], ax
mov a, !LOWW(_g_tau1_ch5_capture_tail@3)
inc a
and a, #0x0F
mov !LOWW(_g_tau1_ch5_capture_tail@3), a
oneb a
pop bc
ret
.BB@LABEL@3_3: ; bb25
clrb a
pop bc
ret
.LFE3:
.TYPE _R_TAU1_Channel5_CaptureOverflowed,function,.LFE4-_R_TAU1_Channel5_CaptureOverflowed
_R_TAU1_Channel5_CaptureOverflowed:
.STACK _R_TAU1_Channel5_CaptureOverflowed = 4
mov a, !LOWW(_g_tau1_ch5_capture_overflow@4)
ret
.LFE4:
.SECTION .data,DATA
.ALIGN 2
.TYPE _g_tau1_ch5_width,object,4
_g_tau1_ch5_width:
.DS (4)
.TYPE _g_tau1_ch5_capture_head@2,object,1
_g_tau1_ch5_capture_head@2:
.DS (1)
.TYPE _g_tau1_ch5_capture_tail@3,object,1
_g_tau1_ch5_capture_tail@3:
.DS (1)
.TYPE _g_tau1_ch5_capture_overflow@4,object,1
_g_tau1_ch5_capture_overflow@4:
.DS (1)
.SECTION .bss,BSS
.ALIGN 2
.TYPE _g_tau1_ch5_low_ticks@1,object,64
_g_tau1_ch5_low_ticks@1:
.DS (64)

4145
tmp/r_main.asm

File diff suppressed because it is too large
Loading…
Cancel
Save