gudae 2 months ago
parent
commit
6f4c40df1a
  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. 4
      DefaultBuild/multical.clnk
  11. 518
      DefaultBuild/multical.map
  12. 2769
      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_wdt.obj
  21. BIN
      DefaultBuild/r_cg_wdt_user.obj
  22. BIN
      DefaultBuild/r_main.obj
  23. BIN
      DefaultBuild/r_systeminit.obj
  24. BIN
      DefaultBuild/uart.obj
  25. 109
      QualityReport(multical,DefaultBuild).txt
  26. 6
      app_owi_service.c
  27. 81
      multical.mtpj
  28. 37
      multical.rcpe
  29. 136
      multical.temp.mtud
  30. 28
      owi.c
  31. 2
      r_cg_cgc.c
  32. 2
      r_cg_cgc.h
  33. 2
      r_cg_cgc_user.c
  34. 2
      r_cg_macrodriver.h
  35. 2
      r_cg_port.c
  36. 2
      r_cg_port.h
  37. 2
      r_cg_port_user.c
  38. 2
      r_cg_serial.c
  39. 2
      r_cg_serial.h
  40. 2
      r_cg_serial_user.c
  41. 2
      r_cg_userdefine.h
  42. 6
      r_cg_wdt.c
  43. 2
      r_cg_wdt.h
  44. 15
      r_cg_wdt_user.c
  45. 301
      r_main.c
  46. 4
      r_systeminit.c

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.

4
DefaultBuild/multical.clnk

@ -18,6 +18,8 @@
-Input=DefaultBuild\app_cmd_parser.obj
-Input=DefaultBuild\app_scheduler.obj
-Input=DefaultBuild\app_owi_service.obj
-Input=DefaultBuild\r_cg_wdt.obj
-Input=DefaultBuild\r_cg_wdt_user.obj
-SECURITY_ID=00000000000000000000
-DEVICE=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10PPJ.DVF
-DEBug
@ -26,7 +28,7 @@
-OUtput=DefaultBuild\multical.abs
-OCDBG=84
-DEBUG_MONITOR=3FE00-3FFFF
-USER_OPT_BYTE=E9FFF8
-USER_OPT_BYTE=78FFF8
-OCDTR
-LISt=DefaultBuild\multical.map
-SHow=SYmbol,Total_size

518
DefaultBuild/multical.map

@ -1,4 +1,4 @@
Renesas Optimizing Linker (W3.07.00 ) 22-Apr-2026 12:34:51
Renesas Optimizing Linker (W3.07.00 ) 08-Jun-2026 14:47:12
*** Options ***
@ -23,6 +23,8 @@ Renesas Optimizing Linker (W3.07.00 ) 22-Apr-2026 12:34:51
-Input=DefaultBuild\app_cmd_parser.obj
-Input=DefaultBuild\app_scheduler.obj
-Input=DefaultBuild\app_owi_service.obj
-Input=DefaultBuild\r_cg_wdt.obj
-Input=DefaultBuild\r_cg_wdt_user.obj
-SECURITY_ID=00000000000000000000
-DEVICE=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10PPJ.DVF
-DEBug
@ -31,7 +33,7 @@ Renesas Optimizing Linker (W3.07.00 ) 22-Apr-2026 12:34:51
-OUtput=DefaultBuild\multical.abs
-OCDBG=84
-DEBUG_MONITOR=3FE00-3FFFF
-USER_OPT_BYTE=E9FFF8
-USER_OPT_BYTE=78FFF8
-OCDTR
-LISt=DefaultBuild\multical.map
-SHow=SYmbol,Total_size
@ -72,9 +74,9 @@ SECTION START END SIZE ALIGN
.const
00003000 0000334d 34e 2
.textf
0000334e 00005dc1 2a74 1
0000334e 00006235 2ee8 1
.SLIB
00005dc2 0000870d 294c 1
00006236 00008b81 294c 1
.monitor2
0003fe00 0003ffff 200 1
.bss
@ -90,7 +92,7 @@ SECTION START END SIZE ALIGN
RAMDATA SECTION: 00002751 Byte(s)
ROMDATA SECTION: 00000a4b Byte(s)
PROGRAM SECTION: 00005571 Byte(s)
PROGRAM SECTION: 000059e5 Byte(s)
*** Symbol List ***
@ -180,487 +182,513 @@ FILE=DefaultBuild\stkinit.obj
LSTINIT3
00003391 0 none ,l *
FILE=DefaultBuild\r_main.obj
00003392 0000482e 149d
00003392 00004c3a 18a9
_send_end_response@1
00003392 8 func ,l *
_out_print@1
0000339a a func ,l *
_uart1_send_string_safe@1
000033a4 a func ,l *
_app_kick_wdt@1
000033ae 5 func ,l *
_delay_ms_wdt@1
000033b3 27 func ,l *
_hex2byte@1
000033ae 56 func ,l *
000033da 56 func ,l *
_relay_init@1
00003404 b func ,l *
00003430 b func ,l *
_relay_on@1
0000340f 4 func ,l *
0000343b 4 func ,l *
_relay_off@1
00003413 4 func ,l *
0000343f 4 func ,l *
_gauge_req_start@1
00003417 16 func ,l *
00003443 16 func ,l *
_gauge_req_stop@1
0000342d 18 func ,l *
00003459 18 func ,l *
_gauge_read_pin@1
00003445 a func ,l *
00003471 a func ,l *
_gauge_wait_pin_state@1
0000344f 43 func ,l *
0000347b 43 func ,l *
_gauge_read_nibble@1
00003492 84 func ,l *
000034be 84 func ,l *
_gauge_is_valid_frame@1
00003516 50 func ,l *
00003542 50 func ,l *
_debug_gauge_levels@1
00003566 7c func ,l *
00003592 7c func ,l *
_gauge_read_aligned_frame@1
000035e2 a7 func ,l *
0000360e a7 func ,l *
_gauge_decode_value@1
00003689 11f func ,l *
000036b5 11f func ,l *
_gauge_reset_state@1
000037d4 2c func ,l *
_gauge_align_captured_frame@1
00003800 47 func ,l *
_gauge_capture_init@1
00003847 37 func ,l *
_gauge_capture_step@1
0000387e de func ,l *
_gauge_finish_captured_frame@1
0000395c 43 func ,l *
_gauge_read_pair@1
0000399f c6 func ,l *
_gauge_read@1
000037a8 50 func ,l *
00003a65 50 func ,l *
_gauge_format_value@1
000037f8 b5 func ,l *
00003ab5 b5 func ,l *
_gauge_setup_pins@1
000038ad 3d func ,l *
00003b6a 3d func ,l *
_build_line_from_rx@1
000038ea 5c func ,l *
00003ba7 5c func ,l *
_print_owi_write_result@1
00003946 45 func ,l *
00003c03 45 func ,l *
_reset_channel_gate_defaults@1
00003c48 10 func ,l *
_print_owi_read_result@1
0000398b 111 func ,l *
00003c58 119 func ,l *
_print_connect_sweep_result@1
00003a9c 49 func ,l *
00003d71 49 func ,l *
_runtime_reset@1
00003ae5 c func ,l *
00003dba c func ,l *
_is_x_off_cmd@1
00003af1 41 func ,l *
00003dc6 41 func ,l *
_is_start_cmd@1
00003b32 40 func ,l *
00003e07 40 func ,l *
_is_stop_cmd@1
00003b72 36 func ,l *
00003e47 36 func ,l *
_is_long_owi_read_len@1
00003ba8 15 func ,l *
00003e7d 15 func ,l *
_do_stable_owi_read@1
00003bbd 93 func ,l *
00003e92 9f func ,l *
_copy_nvm_tail8@1
00003c50 49 func ,l *
00003f31 49 func ,l *
_tails_match_8@1
00003c99 1e func ,l *
00003f7a 1e func ,l *
_tail8_to_hex16@1
00003cb7 4c func ,l *
00003f98 4c func ,l *
_read_connected_nvm_tail8@1
00003d03 78 func ,l *
00003fe4 78 func ,l *
_read_connected_nvm_last16@1
00003d7b 1dd func ,l *
0000405c 1dd func ,l *
_run_connect_verify_one_channel@1
00003f58 183 func ,l *
00004239 257 func ,l *
_execute_connect_verify_sequence@1
000040db 7d func ,l *
00004490 7d func ,l *
_execute_direct_read_sequence@1
00004158 198 func ,l *
0000450d 1b0 func ,l *
_do_nvm_read_after_gauge@1
000042f0 24 func ,l *
000046bd 24 func ,l *
_execute_owi_service_from_job@1
00004314 da func ,l *
000046e1 e5 func ,l *
_process_local_legacy_line@1
000043ee 269 func ,l *
000047c6 26a func ,l *
_process_one_line@1
00004657 11e func ,l *
00004a30 139 func ,l *
_app_runtime_try_start@1
00004775 14 func ,l *
00004b69 14 func ,l *
_app_job_tick@1
00004789 39 func ,l *
00004b7d 39 func ,l *
_main
000047c2 65 func ,g *
00004bb6 7d func ,g *
_R_MAIN_UserInit
00004827 8 func ,g *
00004c33 8 func ,g *
FILE=DefaultBuild\r_systeminit.obj
0000482f 0000486f 41
00004c3b 00004c7f 45
_R_Systeminit
0000482f 3a func ,g *
00004c3b 3e func ,g *
_hdwinit
00004869 7 func ,g *
00004c79 7 func ,g *
FILE=DefaultBuild\r_cg_cgc.obj
00004870 00004899 2a
00004c80 00004ca9 2a
_R_CGC_Create
00004870 2a func ,g *
00004c80 2a func ,g *
FILE=DefaultBuild\r_cg_cgc_user.obj
0000489a 0000489c 3
00004caa 00004cac 3
_R_CGC_Get_ResetSource
0000489a 3 func ,g *
00004caa 3 func ,g *
FILE=DefaultBuild\r_cg_serial.obj
0000489d 00004b84 2e8
00004cad 00004f94 2e8
_R_SAU0_Create
0000489d 12 func ,g *
00004cad 12 func ,g *
_R_UART0_Create
000048af 6e func ,g *
00004cbf 6e func ,g *
_R_UART0_Start
0000491d 26 func ,g *
00004d2d 26 func ,g *
_R_UART0_Stop
00004943 1e func ,g *
00004d53 1e func ,g *
_R_UART0_Receive
00004961 18 func ,g *
00004d71 18 func ,g *
_R_UART0_Send
00004979 26 func ,g *
00004d89 26 func ,g *
_R_SAU1_Create
0000499f 12 func ,g *
00004daf 12 func ,g *
_R_UART1_Create
000049b1 6e func ,g *
00004dc1 6e func ,g *
_R_UART1_Start
00004a1f 26 func ,g *
00004e2f 26 func ,g *
_R_UART1_Stop
00004a45 1e func ,g *
00004e55 1e func ,g *
_R_UART1_Receive
00004a63 18 func ,g *
00004e73 18 func ,g *
_R_UART1_Send
00004a7b 26 func ,g *
00004e8b 26 func ,g *
_R_IICA0_Create
00004aa1 50 func ,g *
00004eb1 50 func ,g *
_R_IICA0_Stop
00004af1 5 func ,g *
00004f01 5 func ,g *
_R_IICA0_StopCondition
00004af6 5 func ,g *
00004f06 5 func ,g *
_R_IICA0_Master_Send
00004afb 43 func ,g *
00004f0b 43 func ,g *
_R_IICA0_Master_Receive
00004b3e 47 func ,g *
00004f4e 47 func ,g *
FILE=DefaultBuild\r_cg_serial_user.obj
00004b85 00004c67 e3
00004f95 00005077 e3
_r_uart0_callback_receiveend@1
00004b85 1 func ,l *
00004f95 1 func ,l *
_r_uart0_callback_softwareoverrun@1
00004b86 1 func ,l *
00004f96 1 func ,l *
_r_uart0_callback_sendend@1
00004b87 1 func ,l *
00004f97 1 func ,l *
_r_uart0_callback_error@1
00004b88 1 func ,l *
00004f98 1 func ,l *
_r_uart1_callback_receiveend@1
00004b89 31 func ,l *
00004f99 31 func ,l *
_r_uart1_callback_softwareoverrun@1
00004bba 1 func ,l *
00004fca 1 func ,l *
_r_uart1_callback_sendend@1
00004bbb 4 func ,l *
00004fcb 4 func ,l *
_r_uart1_callback_error@1
00004bbf 1 func ,l *
00004fcf 1 func ,l *
_iica0_masterhandler@1
00004bc0 91 func ,l *
00004fd0 91 func ,l *
_r_iica0_callback_master_error@1
00004c51 7 func ,l *
00005061 7 func ,l *
_r_iica0_callback_master_receiveend@1
00004c58 8 func ,l *
00005068 8 func ,l *
_r_iica0_callback_master_sendend@1
00004c60 8 func ,l *
00005070 8 func ,l *
FILE=DefaultBuild\r_cg_port.obj
00004c68 00004c8c 25
00005078 0000509c 25
_R_PORT_Create
00004c68 25 func ,g *
00005078 25 func ,g *
FILE=DefaultBuild\owi.obj
00004c8d 000053c5 739
0000509d 00005817 77b
_OWI_KickWdt@1
0000509d 5 func ,l *
_GPIO_Clear
00004c8d 12 func ,g *
000050a2 12 func ,g *
_GPIO_Input
00004c9f 11 func ,g *
000050b4 11 func ,g *
_GPIO_Read
00004cb0 9 func ,g *
000050c5 9 func ,g *
_OWI_Release@1
00004cb9 11 func ,l *
000050ce 11 func ,l *
_GPIO_StrongDriveHighKick@1
00004cca 32 func ,l *
000050df 32 func ,l *
_GPIO_ForceHighKick
00004cfc 8 func ,g *
00005111 8 func ,g *
_OWI_DriveLow@1
00004d04 12 func ,l *
00005119 12 func ,l *
_OWI_HasTimeout
00004d16 4 func ,g *
0000512b 4 func ,g *
_OWI_ClearTimeout
00004d1a e func ,g *
0000512f e func ,g *
_OWI_GetLastTimeoutByteIndex
00004d28 4 func ,g *
0000513d 4 func ,g *
_OWI_GetLastTimeoutBitIndex
00004d2c 4 func ,g *
00005141 4 func ,g *
_OWI_Init
00004d30 1b func ,g *
00005145 1e func ,g *
_OWI_Start
00004d4b 17 func ,g *
00005163 17 func ,g *
_OWI_Stop
00004d62 14 func ,g *
0000517a 14 func ,g *
_OWI_StopRead@1
00004d76 17 func ,l *
0000518e 17 func ,l *
_OWI_WaitForFallingEdge@1
00004d8d 4b func ,l *
000051a5 4b func ,l *
_OWI_ReadByte_StreamSynced@1
00004dd8 73 func ,l *
000051f0 73 func ,l *
_OWI_SecureStop
00004e4b 51 func ,g *
00005263 51 func ,g *
_OWI_WriteBit
00004e9c 37 func ,g *
000052b4 37 func ,g *
_OWI_WriteByte
00004ed3 2a func ,g *
000052eb 2a func ,g *
_OWI_ReadBit
00004efd af func ,g *
00005315 af func ,g *
_OWI_ReadByte
00004fac 48 func ,g *
000053c4 48 func ,g *
_OWI_T_ReadBytesAndPrint
00004ff4 117 func ,g *
0000540c 117 func ,g *
_owi_result_init@1
0000510b 21 func ,l *
00005523 21 func ,l *
_owi_result_latch_timeout@1
0000512c 29 func ,l *
00005544 29 func ,l *
_OWI_T_CommandModeRaw
00005155 4d func ,g *
0000556d 63 func ,g *
_OWI_CommandModeRaw
000051a2 4d func ,g *
000055d0 63 func ,g *
_OWI_ReadBytesRaw
000051ef bf func ,g *
00005633 cd func ,g *
_OWI_disable
000052ae 8 func ,g *
00005700 8 func ,g *
_OWI_T_CommandMode
000052b6 18 func ,g *
00005708 18 func ,g *
_OWI_CommandMode
000052ce 18 func ,g *
00005720 18 func ,g *
_OWI_ReadBytesAndPrint
000052e6 e0 func ,g *
00005738 e0 func ,g *
FILE=DefaultBuild\i2c.obj
000053c6 000054ee 129
00005818 00005940 129
_disable
000053c6 19 func ,g *
00005818 19 func ,g *
_I2C_EnablePower
000053df 4 func ,g *
00005831 4 func ,g *
_I2C_DisablePower
000053e3 3 func ,g *
00005835 3 func ,g *
_I2C_T_Command_Mode_receiveData
000053e6 36 func ,g *
00005838 36 func ,g *
_I2C_Command_Mode_receiveData
0000541c 27 func ,g *
0000586e 27 func ,g *
_I2C_Command_Mode_Send
00005443 ac func ,g *
00005895 ac func ,g *
FILE=DefaultBuild\uart.obj
000054ef 0000558d 9f
00005941 000059df 9f
_UART1_WaitTxIdle@1
000054ef 2c func ,l *
00005941 2c func ,l *
_uart1_send_string
0000551b 40 func ,g *
0000596d 40 func ,g *
_uart1_send_hex
0000555b 33 func ,g *
000059ad 33 func ,g *
FILE=DefaultBuild\delay.obj
0000558e 0000564c bf
000059e0 00005a9e bf
_delay
0000558e 18 func ,g *
000059e0 18 func ,g *
_delay_us
000055a6 82 func ,g *
000059f8 82 func ,g *
_delay_ms
00005628 25 func ,g *
00005a7a 25 func ,g *
FILE=DefaultBuild\dipSwitch.obj
0000564d 0000565d 11
00005a9f 00005aaf 11
_DipSwitch_Init
0000564d 8 func ,g *
00005a9f 8 func ,g *
_DipSwitch_ReadAddr_0to31
00005655 9 func ,g *
00005aa7 9 func ,g *
FILE=DefaultBuild\gatectrl.obj
0000565e 000056d7 7a
00005ab0 00005b29 7a
_Gate_SetByNum
0000565e 49 func ,g *
00005ab0 49 func ,g *
_Cal_Init
000056a7 21 func ,g *
00005af9 21 func ,g *
_GateCtrl_SelectChannel
000056c8 10 func ,g *
00005b1a 10 func ,g *
FILE=DefaultBuild\app_result.obj
000056d8 000056e1 a
00005b2a 00005b33 a
_app_result_print_ok
000056d8 5 func ,g *
00005b2a 5 func ,g *
_app_result_print_err
000056dd 5 func ,g *
00005b2f 5 func ,g *
FILE=DefaultBuild\app_cmd_parser.obj
000056e2 00005ab6 3d5
00005b34 00005f08 3d5
_find_payload_pos@1
000056e2 1b func ,l *
00005b34 1b func ,l *
_hex_nibble@1
000056fd 31 func ,l *
00005b4f 31 func ,l *
_hex_pair_to_u8@1
0000572e 30 func ,l *
00005b80 30 func ,l *
_app_cmd_parse_line
0000575e 359 func ,g *
00005bb0 359 func ,g *
FILE=DefaultBuild\app_scheduler.obj
00005ab7 00005b52 9c
00005f09 00005fa4 9c
_app_scheduler_init
00005ab7 15 func ,g *
00005f09 15 func ,g *
_app_scheduler_push
00005acc 38 func ,g *
00005f1e 38 func ,g *
_app_scheduler_pop
00005b04 31 func ,g *
00005f56 31 func ,g *
_app_scheduler_is_empty
00005b35 9 func ,g *
00005f87 9 func ,g *
_app_scheduler_clear
00005b3e 15 func ,g *
00005f90 15 func ,g *
FILE=DefaultBuild\app_owi_service.obj
00005b53 00005dc1 26f
00005fa5 0000622a 286
_app_owi_from_raw@1
00005b53 86 func ,l *
00005fa5 86 func ,l *
_is_long_owi_read@1
00005bd9 15 func ,l *
0000602b 15 func ,l *
_looks_bad_tail@1
00005bee 5c func ,l *
00006040 5c func ,l *
_looks_bad_last_bytes@1
00005c4a 48 func ,l *
0000609c 48 func ,l *
_ends_with_ff_pair@1
00005c92 25 func ,l *
000060e4 25 func ,l *
_needs_retry_for_long_read@1
00005cb7 42 func ,l *
00006109 42 func ,l *
_app_owi_read_basic
00005cf9 6f func ,g *
0000614b 86 func ,g *
_app_owi_write_basic
00005d68 2d func ,g *
000061d1 2d func ,g *
_app_owi_write_t_basic
00005d95 2d func ,g *
000061fe 2d func ,g *
FILE=DefaultBuild\r_cg_wdt.obj
0000622b 00006235 b
_R_WDT_Create
0000622b 7 func ,g *
_R_WDT_Restart
00006232 4 func ,g *
SECTION=.SLIB
FILE=_COM_fdiv
00005dc2 00005eef 12e
00006236 00006363 12e
__COM_fdiv
00005e21 0 none ,g *
00006295 0 none ,g *
FILE=_COM_sltof
00005ef0 00005f07 18
00006364 0000637b 18
__COM_sltof
00005ef0 0 none ,g *
00006364 0 none ,g *
FILE=isdigit
00005f08 00005f11 a
0000637c 00006385 a
_isdigit
00005f08 0 none ,g *
0000637c 0 none ,g *
FILE=memcmp
00005f12 00005f23 12
00006386 00006397 12
_memcmp
00005f12 0 none ,g *
00006386 0 none ,g *
FILE=memcpy
00005f24 00005f33 10
00006398 000063a7 10
_memcpy
00005f24 0 none ,g *
00006398 0 none ,g *
FILE=memset
00005f34 00005f41 e
000063a8 000063b5 e
_memset
00005f34 0 none ,g *
000063a8 0 none ,g *
FILE=sprintf
00005f42 0000603a f9
000063b6 000064ae f9
_sprintf
00005f42 e1 func ,g *
000063b6 e1 func ,g *
__REL_sp@1
00006023 18 func ,l *
00006497 18 func ,l *
FILE=strchr
0000603b 00006048 e
000064af 000064bc e
_strchr
0000603b 0 none ,g *
000064af 0 none ,g *
FILE=strcpy
00006049 00006055 d
000064bd 000064c9 d
_strcpy
00006049 0 none ,g *
000064bd 0 none ,g *
FILE=strlen
00006056 00006060 b
000064ca 000064d4 b
_strlen
00006056 0 none ,g *
000064ca 0 none ,g *
FILE=strncpy
00006061 00006074 14
000064d5 000064e8 14
_strncpy
00006061 0 none ,g *
000064d5 0 none ,g *
FILE=toupper
00006075 00006082 e
000064e9 000064f6 e
_toupper
00006075 0 none ,g *
000064e9 0 none ,g *
FILE=_REL_f_inf
00006083 0000608a 8
000064f7 000064fe 8
__REL_f_inf
00006083 0 none ,g *
000064f7 0 none ,g *
FILE=_REL_f_norm
0000608b 0000609a 10
000064ff 0000650e 10
__REL_f_norm
0000608b 0 none ,g *
000064ff 0 none ,g *
FILE=_REL_f_round
0000609b 000060ad 13
0000650f 00006521 13
__REL_f_round
0000609b 0 none ,g *
0000650f 0 none ,g *
FILE=_REL_ltof
000060ae 000060f7 4a
00006522 0000656b 4a
__REL_ltof
000060ae 0 none ,g *
00006522 0 none ,g *
FILE=_REL_print
000060f8 0000804f 1f58
0000656c 000084c3 1f58
__REL_print
000060f8 1046 func ,g *
0000656c 1046 func ,g *
__REL_fltprn@1
0000713e 941 func ,l *
000075b2 941 func ,l *
__REL_henkan1@1
00007a7f 28 func ,l *
00007ef3 28 func ,l *
__REL_henkan2@1
00007aa7 33 func ,l *
00007f1b 33 func ,l *
__REL_pri@1
00007ada 298 func ,l *
00007f4e 298 func ,l *
__REL_fltgeti@1
00007d72 19d func ,l *
000081e6 19d func ,l *
__REL_inmod@1
00007f0f 141 func ,l *
00008383 141 func ,l *
FILE=_COM_feq
00008050 00008065 16
000084c4 000084d9 16
__COM_feq
00008050 0 none ,g *
000084c4 0 none ,g *
FILE=_COM_fge
00008066 0000807b 16
000084da 000084ef 16
__COM_fge
00008066 0 none ,g *
000084da 0 none ,g *
FILE=_COM_flt
0000807c 00008091 16
000084f0 00008505 16
__COM_flt
0000807c 0 none ,g *
000084f0 0 none ,g *
FILE=_COM_fmul
00008092 0000817e ed
00008506 000085f2 ed
__COM_fmul
000080dd 0 none ,g *
00008551 0 none ,g *
FILE=_COM_fne
0000817f 0000818f 11
000085f3 00008603 11
__COM_fne
0000817f 0 none ,g *
000085f3 0 none ,g *
FILE=_COM_ftosl
00008190 00008197 8
00008604 0000860b 8
__COM_ftosl
00008190 0 none ,g *
00008604 0 none ,g *
FILE=_COM_sidiv
00008198 000081b9 22
0000860c 0000862d 22
__COM_sidiv
0000819a 0 none ,g *
0000860e 0 none ,g *
FILE=_COM_sirem
000081ba 000081d9 20
0000862e 0000864d 20
__COM_sirem
000081ba 0 none ,g *
0000862e 0 none ,g *
FILE=_COM_ulldiv
000081da 00008203 2a
0000864e 00008677 2a
__COM_ulldiv
000081da 0 none ,g *
0000864e 0 none ,g *
FILE=_COM_ullrem
00008204 00008234 31
00008678 000086a8 31
__COM_ullrem
00008204 0 none ,g *
00008678 0 none ,g *
FILE=_REL_fcmp
00008235 0000826c 38
000086a9 000086e0 38
__REL_fcmp
00008235 0 none ,g *
000086a9 0 none ,g *
FILE=_REL_fordered_core
0000826d 00008288 1c
000086e1 000086fc 1c
__REL_fordered_core
0000826d 0 none ,g *
000086e1 0 none ,g *
FILE=_REL_ftol
00008289 000082bd 35
000086fd 00008731 35
__REL_ftol
00008289 0 none ,g *
000086fd 0 none ,g *
FILE=_REL_lldiv
000082be 000084c3 206
00008732 00008937 206
__REL_lldiv
000082da 0 none ,g *
0000874e 0 none ,g *
FILE=_REL_llrem
000084c4 000086c7 204
00008938 00008b3b 204
__REL_llrem
000084e1 0 none ,g *
00008955 0 none ,g *
FILE=_REL_ltosl
000086c8 000086ec 25
00008b3c 00008b60 25
__REL_ltosl
000086c8 0 none ,g *
00008b3c 0 none ,g *
FILE=_COM_lshr
000086ed 0000870d 21
00008b61 00008b81 21
__COM_lshr
000086f7 0 none ,g *
00008b6b 0 none ,g *
SECTION=.monitor2
FILE=rlink_generates_02
@ -803,7 +831,7 @@ FILE=rlink_generates_05
__s.textf
0000334e 0 none ,g *
__e.textf
00005dc2 0 none ,g *
00006236 0 none ,g *
__s.const
00003000 0 none ,g *
__e.const
@ -845,9 +873,9 @@ FILE=rlink_generates_05
__e.RLIB
000000c4 0 none ,g *
__s.SLIB
00005dc2 0 none ,g *
00006236 0 none ,g *
__e.SLIB
0000870e 0 none ,g *
00008b82 0 none ,g *
__s.option_byte
000000c0 0 none ,g *
__e.option_byte

2769
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_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.

109
QualityReport(multical,DefaultBuild).txt

@ -1,13 +1,104 @@
QualityReport
2026년 4월 23일 목요일 오후 4:07:07
2026년 6월 8일 월요일 오후 2:47:12
------ Start build(multical, DefaultBuild) ------
------ Build ended(Error:0, Warning:0)(multical, DefaultBuild) ------
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\Bin\ccrl.exe r_main.c -cpu=S3 -o DefaultBuild\r_main.obj "-dev=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10PPJ.DVF" -g -g_line -I "..\..\Documents\카카오톡 받은 파일\IDH1.1\IDH1.1" -I ..\IDH1.1 -I . -c -msg_lang=english
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\Bin\ccrl.exe app_owi_service.c -cpu=S3 -o DefaultBuild\app_owi_service.obj "-dev=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10PPJ.DVF" -g -g_line -I "..\..\Documents\카카오톡 받은 파일\IDH1.1\IDH1.1" -I ..\IDH1.1 -I . -c -msg_lang=english
W0511106:The folder "..\..\Documents\카카오톡 받은 파일\IDH1.1\IDH1.1" specified by the "-I" option is not found.
W0511187:The evaluation period for the option "-Odefault" of CC-RL V1 has expired. It is implicitly changed to "-Olite". Please consider purchasing the product to continue using "-Odefault". By explicitly specifying "-Olite" or "-Onothing", this warning message disappears.
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")
r_main.c(1093):W0520111:Statement is unreachable
r_main.c(241):W0520177:Function "debug_ck_edges" was declared but never referenced
r_main.c(581):W0520177:Function "gauge_print_value" was declared but never referenced
W0511106:The folder "..\..\Documents\카카오톡 받은 파일\IDH1.1\IDH1.1" specified by the "-I" option is not found.
W0511187:The evaluation period for the option "-Odefault" of CC-RL V1 has expired. It is implicitly changed to "-Olite". Please consider purchasing the product to continue using "-Odefault". By explicitly specifying "-Olite" or "-Onothing", this warning message disappears.
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\Bin\ccrl.exe owi.c -cpu=S3 -o DefaultBuild\owi.obj "-dev=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10PPJ.DVF" -g -g_line -I "..\..\Documents\카카오톡 받은 파일\IDH1.1\IDH1.1" -I ..\IDH1.1 -I . -c -msg_lang=english
W0511106:The folder "..\..\Documents\카카오톡 받은 파일\IDH1.1\IDH1.1" specified by the "-I" option is not found.
W0511187:The evaluation period for the option "-Odefault" of CC-RL V1 has expired. It is implicitly changed to "-Olite". Please consider purchasing the product to continue using "-Odefault". By explicitly specifying "-Olite" or "-Onothing", this warning message disappears.
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")
owi.c(537):W0520549:Variable "r" is used before its value is set
owi.c(546):W0520549:Variable "r" is used before its value is set
owi.c(148):W0520177:Function "OWI_StopWrite" was declared but never referenced
owi.c(163):W0520177:Function "OWI_WaitFirstBitStart" was declared but never referenced
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\Bin\rlink.exe -subcommand=DefaultBuild\multical.clnk
W0561017:Paid license of CC-RL V1 is not found, and the evaluation period has expired. Please consider purchasing the product.
W0561017:Paid license of CC-RL V1 is not found, and the evaluation period has expired. Please consider purchasing the product.
Renesas Optimizing Linker Completed
------ Build ended(Error:0, Warning:35)(multical, DefaultBuild) ------
--- CommandFile 1 ---
DefaultBuild\multical.clnk :
-Input=DefaultBuild\cstart.obj
-Input=DefaultBuild\stkinit.obj
-Input=DefaultBuild\r_main.obj
-Input=DefaultBuild\r_systeminit.obj
-Input=DefaultBuild\r_cg_cgc.obj
-Input=DefaultBuild\r_cg_cgc_user.obj
-Input=DefaultBuild\r_cg_serial.obj
-Input=DefaultBuild\r_cg_serial_user.obj
-Input=DefaultBuild\r_cg_port.obj
-Input=DefaultBuild\r_cg_port_user.obj
-Input=DefaultBuild\owi.obj
-Input=DefaultBuild\i2c.obj
-Input=DefaultBuild\uart.obj
-Input=DefaultBuild\delay.obj
-Input=DefaultBuild\dipSwitch.obj
-Input=DefaultBuild\gatectrl.obj
-Input=DefaultBuild\app_result.obj
-Input=DefaultBuild\app_cmd_parser.obj
-Input=DefaultBuild\app_scheduler.obj
-Input=DefaultBuild\app_owi_service.obj
-Input=DefaultBuild\r_cg_wdt.obj
-Input=DefaultBuild\r_cg_wdt_user.obj
-SECURITY_ID=00000000000000000000
-DEVICE=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10PPJ.DVF
-DEBug
-NOCOmpress
-NOOPtimize
-OUtput=DefaultBuild\multical.abs
-OCDBG=84
-DEBUG_MONITOR=3FE00-3FFFF
-USER_OPT_BYTE=78FFF8
-OCDTR
-LISt=DefaultBuild\multical.map
-SHow=SYmbol,Total_size
-AUTO_SECTION_LAYOUT
-ROm=.data=.dataR
-ROm=.sdata=.sdataR
-NOMessage
-MEMory=High
-NOLOgo
-LIBrary=DefaultBuild\multical.lib
-end
-Input=DefaultBuild\multical.abs
-DEVICE=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10PPJ.DVF
-OUtput=DefaultBuild\multical.mot
-FOrm=Stype
-NOMessage
-exit
--- SHA1 hash value of output files ---
C:\Users\temp\Desktop\measurement_fw\DefaultBuild\multical.abs: 9543f1f65ea23748ac6d913fc6e419498be174a9
C:\Users\temp\Desktop\measurement_fw\DefaultBuild\multical.mot: bdae3e1e99d83cfa9b7c2dc20cfbfb6bba0120f6
C:\Users\temp\Desktop\measurement_fw\DefaultBuild\multical.abs: 4653592a84b5abb7ff4fa5162688b90cd520c9f9
C:\Users\temp\Desktop\measurement_fw\DefaultBuild\multical.mot: 006906a6ae1bbda7d0cc35dc837923cd4e073f90
--- System Information ---
@ -18,7 +109,7 @@ C:\Users\temp\Desktop\measurement_fw\DefaultBuild\multical.mot: bdae3e1e99d83cfa
*.NET Framework Version
Microsoft .NET Framework 4 [.NET 4.8 or later] (533325)
*WebView2 Version
147.0.3912.72
148.0.3967.96
--- Application Information ---
*Product Name
@ -35,13 +126,13 @@ C:\Users\temp\Desktop\measurement_fw\DefaultBuild\multical.mot: bdae3e1e99d83cfa
C:\Program Files (x86)\Renesas Electronics\CS+\CC
*Memory Usage
*Private Working Set
233 MB
381 MB
*Number of GDI Objects
2727
3079
*Number of USER Objects
1671
1880
*Opened Files
34 editors, 34 files, 199 KB
36 editors, 36 files, 214 KB
--- Build Tool Plug-in Information ---
RH850 Build tool CC-RH Plug-in

6
app_owi_service.c

@ -1,6 +1,7 @@
#include "app_owi_service.h"
#include "owi.h"
#include "delay.h"
#include "r_cg_wdt.h"
#include <string.h>
static app_owi_result_t app_owi_from_raw(const owi_io_result_t *io)
@ -117,11 +118,16 @@ app_owi_result_t app_owi_read_basic(uint8_t id, int length)
{
owi_io_result_t io;
R_WDT_Restart();
OWI_ReadBytesRaw(length, id, &io);
R_WDT_Restart();
if (needs_retry_for_long_read(&io, length)) {
R_WDT_Restart();
delay_us(3000u);
R_WDT_Restart();
OWI_ReadBytesRaw(length, id, &io);
R_WDT_Restart();
/* ??? ??? ???? ?? ?? */
if (needs_retry_for_long_read(&io, length)) {

81
multical.mtpj

@ -133,6 +133,27 @@
<TreeImageGuid>03cad1e8-2eb3-4cde-a8a3-982423631122</TreeImageGuid>
<ParentItem>cd2e4292-1297-4c3b-8415-f027a507b349</ParentItem>
</Instance>
<Instance Guid="7b2523c3-c8a7-4d28-b202-63e4967826c9">
<Name>r_cg_wdt.c</Name>
<Type>File</Type>
<RelativePath>r_cg_wdt.c</RelativePath>
<TreeImageGuid>941832c1-fc3b-4e1b-94e8-01ea17128b42</TreeImageGuid>
<ParentItem>cd2e4292-1297-4c3b-8415-f027a507b349</ParentItem>
</Instance>
<Instance Guid="52d34f97-2327-4b3c-b1c5-585ce576d939">
<Name>r_cg_wdt_user.c</Name>
<Type>File</Type>
<RelativePath>r_cg_wdt_user.c</RelativePath>
<TreeImageGuid>941832c1-fc3b-4e1b-94e8-01ea17128b42</TreeImageGuid>
<ParentItem>cd2e4292-1297-4c3b-8415-f027a507b349</ParentItem>
</Instance>
<Instance Guid="31be2478-2d70-47a4-b91d-4e924305d4c8">
<Name>r_cg_wdt.h</Name>
<Type>File</Type>
<RelativePath>r_cg_wdt.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>
@ -432,7 +453,11 @@
<SourceItemType18>CSource</SourceItemType18>
<SourceItemGuid19>b7caf418-449c-4afa-9d64-16f7aef4371a</SourceItemGuid19>
<SourceItemType19>CSource</SourceItemType19>
<SourceItemCount>20</SourceItemCount>
<SourceItemGuid20>7b2523c3-c8a7-4d28-b202-63e4967826c9</SourceItemGuid20>
<SourceItemType20>CSource</SourceItemType20>
<SourceItemGuid21>52d34f97-2327-4b3c-b1c5-585ce576d939</SourceItemGuid21>
<SourceItemType21>CSource</SourceItemType21>
<SourceItemCount>22</SourceItemCount>
<LastDeviceChangedCounter>0</LastDeviceChangedCounter>
<LastDeviceNameOnPG>R5F10PPJ</LastDeviceNameOnPG>
<LastDeviceChangedCounterOnPG>0</LastDeviceChangedCounterOnPG>
@ -884,7 +909,7 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
<LinkOptionRrm-DefaultValue>False</LinkOptionRrm-DefaultValue>
<LinkOptionRrmValue-DefaultValue />
<IsLockedByUser>False</IsLockedByUser>
<TimeTagModified--0>-8584319544808423931</TimeTagModified--0>
<TimeTagModified--0>-8584207126499968324</TimeTagModified--0>
<LinkOptionAutoSectionLayout-0>True</LinkOptionAutoSectionLayout-0>
<LinkOptionCpu-0>False</LinkOptionCpu-0>
<LinkOptionDebug-0>Debug</LinkOptionDebug-0>
@ -962,7 +987,7 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
<LinkOptionChangeMessageError-0>None</LinkOptionChangeMessageError-0>
<LinkOptionSameCodeForbid-0 />
<LinkOptionShowStruct-0>False</LinkOptionShowStruct-0>
<LinkOptionUserOptByteValue-0>E9FFF8</LinkOptionUserOptByteValue-0>
<LinkOptionUserOptByteValue-0>78FFF8</LinkOptionUserOptByteValue-0>
<LinkOptionChangeMessageErrorNumber-0 />
<LinkOptionSectionForbid-0 />
<LinkOptionSelf-0>None</LinkOptionSelf-0>
@ -1376,6 +1401,18 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
<ItemAddTime>639087102722017417</ItemAddTime>
<ItemAddTimeCount>0</ItemAddTimeCount>
</Instance>
<Instance Guid="7b2523c3-c8a7-4d28-b202-63e4967826c9">
<ItemAddTime>639165234354757189</ItemAddTime>
<ItemAddTimeCount>0</ItemAddTimeCount>
</Instance>
<Instance Guid="52d34f97-2327-4b3c-b1c5-585ce576d939">
<ItemAddTime>639165234354757189</ItemAddTime>
<ItemAddTimeCount>1</ItemAddTimeCount>
</Instance>
<Instance Guid="31be2478-2d70-47a4-b91d-4e924305d4c8">
<ItemAddTime>639165234354757189</ItemAddTime>
<ItemAddTimeCount>2</ItemAddTimeCount>
</Instance>
<Instance Guid="0b7e78c3-aadd-45ee-9f9d-ffac6141eeb2">
<TimeTagModified-SourceItem0--0>-8584334295854395005</TimeTagModified-SourceItem0--0>
<SourceItem0-IsLockedByUser>False</SourceItem0-IsLockedByUser>
@ -1459,6 +1496,14 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
<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>
<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>
<SourceItem21-IsLockedByUser>False</SourceItem21-IsLockedByUser>
<SourceItem21-BuildingTarget-0>True</SourceItem21-BuildingTarget-0>
<SourceItem21-IndividualCompileOption-0>False</SourceItem21-IndividualCompileOption-0>
</Instance>
</Class>
<Class Guid="44fa27c9-0aa0-4297-bd3b-2c5c5bdb8881">
@ -4431,7 +4476,7 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
&lt;StartAddressOfOnChipDebugOptionBytes Name="GOStart" Text="3FE00" /&gt;
&lt;SizeOfOnChipDebugOptionBytesArea Name="GOSizeValue" Text="512" /&gt;
&lt;UserOptionBytes Name="GB" Text="1" /&gt;
&lt;UserOptionBytesValue Name="GBValue" Text="E9FFF8" /&gt;
&lt;UserOptionBytesValue Name="GBValue" Text="78FFF8" /&gt;
&lt;RAMStartAddress Chip="R5F10PGJ,R5F10PLJ,R5F10PMJ,R5F10PPJ" Name="RAMStartAddress" Fixed="" Text="000FAF00" /&gt;
&lt;RAMEndAddress Name="RAMEndAddress" Fixed="" Text="000FFEFF" /&gt;
&lt;ROMEndAddress Chip="R5F10PGJ,R5F10PLJ,R5F10PMJ,R5F10PPJ" Name="ROMEndAddress" Fixed="" Text="0003FFFF" /&gt;
@ -5679,17 +5724,17 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
&lt;r_cg_timer.h UserName="r_cg_timer.h" LibName=".h" InUse="0" /&gt;
&lt;/TAU&gt;
&lt;WDT&gt;
&lt;r_cg_wdt.c UserName="r_cg_wdt.c" LibName=".c" InUse="0"&gt;
&lt;r_cg_wdt.c UserName="r_cg_wdt.c" LibName=".c" InUse="1"&gt;
&lt;Type R_WDT_Create="void R_WDT_Create(void)" R_WDT_Restart="void R_WDT_Restart(void)" /&gt;
&lt;R_WDT_Create UserName="R_WDT_Create" LibName="R_WDT_Create" InUse="0" Init="1" InitMode="" /&gt;
&lt;R_WDT_Restart UserName="R_WDT_Restart" LibName="R_WDT_Restart" InUse="0" /&gt;
&lt;R_WDT_Create UserName="R_WDT_Create" LibName="R_WDT_Create" InUse="1" Init="1" InitMode="" /&gt;
&lt;R_WDT_Restart UserName="R_WDT_Restart" LibName="R_WDT_Restart" InUse="1" /&gt;
&lt;/r_cg_wdt.c&gt;
&lt;r_cg_wdt_user.c UserName="r_cg_wdt_user.c" LibName="_user.c" InUse="0"&gt;
&lt;r_cg_wdt_user.c UserName="r_cg_wdt_user.c" LibName="_user.c" InUse="1"&gt;
&lt;Type R_WDT_Create_UserInit="void R_WDT_Create_UserInit(void)" r_wdt_interrupt="__interrupt static void r_wdt_interrupt(void)" /&gt;
&lt;R_WDT_Create_UserInit UserName="R_WDT_Create_UserInit" LibName="R_WDT_Create_UserInit" InUse="0" /&gt;
&lt;r_wdt_interrupt UserName="r_wdt_interrupt" INTHandle="" LibName="r_wdt_interrupt" InUse="0" /&gt;
&lt;/r_cg_wdt_user.c&gt;
&lt;r_cg_wdt.h UserName="r_cg_wdt.h" LibName=".h" InUse="0" /&gt;
&lt;r_cg_wdt.h UserName="r_cg_wdt.h" LibName=".h" InUse="1" /&gt;
&lt;/WDT&gt;
&lt;RTC&gt;
&lt;r_cg_rtc.c UserName="r_cg_rtc.c" LibName=".c" InUse="0"&gt;
@ -5919,7 +5964,7 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
&lt;cg_ocd_trace_size Name="cg_ocd_trace_size" Value="512" /&gt;
&lt;cg_security8 Name="cg_security8" Value="00" /&gt;
&lt;cg_security4 Name="cg_security4" Value="00" /&gt;
&lt;wdt_option Name="wdt_option" Value="E9" /&gt;
&lt;wdt_option Name="wdt_option" Value="78" /&gt;
&lt;cg_crc_area Name="cg_crc_area" Value="00" /&gt;
&lt;cg_security3 Name="cg_security3" Value="00" /&gt;
&lt;cg_iawctl_value Name="cg_iawctl_value" Value="00" /&gt;
@ -5981,8 +6026,8 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
&lt;TMRD0 SetFlag="False" MacroName="TMRD" Channel="0" TabEnable="True" /&gt;
&lt;TMRD1 SetFlag="False" MacroName="TMRD" Channel="1" TabEnable="True" /&gt;
&lt;/TAU&gt;
&lt;WDT Prepared="true" SetFlag="False" HelpID="watchdogtimer" NeedRefresh="False"&gt;
&lt;WDT SetFlag="False" MacroName="WDT" /&gt;
&lt;WDT Prepared="true" SetFlag="True" HelpID="watchdogtimer" NeedRefresh="False"&gt;
&lt;WDT SetFlag="True" MacroName="WDT" /&gt;
&lt;/WDT&gt;
&lt;RTC SetFlag="False" HelpID="rtc" NeedRefresh="False"&gt;
&lt;RTC MacroName="RTC" SetFlag="False" /&gt;
@ -7251,13 +7296,13 @@ C:\Program Files (x86)\Renesas Electronics\CS+\CC\FAA\V1.05.00
&lt;/PortP15&gt;
&lt;/PORT&gt;
&lt;WDT&gt;
&lt;setting name="WDT_MODULE_USED" value="false" /&gt;
&lt;setting name="WDT_MODULE_UNUSE" value="true" /&gt;
&lt;setting name="WDT_MODULE_USED" value="true" /&gt;
&lt;setting name="WDT_MODULE_UNUSE" value="false" /&gt;
&lt;setting name="WDT_OVERFLOW_TIME" value="4" /&gt;
&lt;setting name="WDT_WINDOW_OPEN_TIME" value="2" /&gt;
&lt;setting name="WDT_HALT_STOP_OPERATION_ENABLE" value="true" /&gt;
&lt;setting name="WDT_HALT_STOP_OPERATION_STOP" value="false" /&gt;
&lt;setting name="WDT_INTERRUPT_USED" value="true" /&gt;
&lt;setting name="WDT_WINDOW_OPEN_TIME" value="0" /&gt;
&lt;setting name="WDT_HALT_STOP_OPERATION_ENABLE" value="false" /&gt;
&lt;setting name="WDT_HALT_STOP_OPERATION_STOP" value="true" /&gt;
&lt;setting name="WDT_INTERRUPT_USED" value="false" /&gt;
&lt;setting name="WDT_INTERRUPT_PRIORITY" value="3" /&gt;
&lt;/WDT&gt;
&lt;ADC&gt;

37
multical.rcpe

@ -24,6 +24,9 @@
<Path>r_cg_port.c</Path>
<Path>r_cg_port_user.c</Path>
<Path>r_cg_port.h</Path>
<Path>r_cg_wdt.c</Path>
<Path>r_cg_wdt_user.c</Path>
<Path>r_cg_wdt.h</Path>
</Category>
<Category Name="drivers">
<Category Name="OWI">
@ -92,6 +95,8 @@
<Path>DefaultBuild\app_cmd_parser.obj</Path>
<Path>DefaultBuild\app_scheduler.obj</Path>
<Path>DefaultBuild\app_owi_service.obj</Path>
<Path>DefaultBuild\r_cg_wdt.obj</Path>
<Path>DefaultBuild\r_cg_wdt_user.obj</Path>
</LinkOrder>
<CommonOptions>
<IncludePathForC>..\..\Documents\카카오톡 받은 파일\IDH1.1\IDH1.1</IncludePathForC>
@ -128,7 +133,7 @@
<Option>-OUtput=%BuildModeName%\%ProjectName%.abs</Option>
<Option>-OCDBG=84</Option>
<Option>-DEBUG_MONITOR=3FE00-3FFFF</Option>
<Option>-USER_OPT_BYTE=E9FFF8</Option>
<Option>-USER_OPT_BYTE=78FFF8</Option>
<Option>-OCDTR</Option>
<Option>-LISt=%BuildModeName%\%ProjectName%.map</Option>
<Option>-SHow=SYmbol,Total_size</Option>
@ -409,7 +414,7 @@
&lt;StartAddressOfOnChipDebugOptionBytes Name="GOStart" Text="3FE00" /&gt;
&lt;SizeOfOnChipDebugOptionBytesArea Name="GOSizeValue" Text="512" /&gt;
&lt;UserOptionBytes Name="GB" Text="1" /&gt;
&lt;UserOptionBytesValue Name="GBValue" Text="E9FFF8" /&gt;
&lt;UserOptionBytesValue Name="GBValue" Text="78FFF8" /&gt;
&lt;RAMStartAddress Chip="R5F10PGJ,R5F10PLJ,R5F10PMJ,R5F10PPJ" Name="RAMStartAddress" Fixed="" Text="000FAF00" /&gt;
&lt;RAMEndAddress Name="RAMEndAddress" Fixed="" Text="000FFEFF" /&gt;
&lt;ROMEndAddress Chip="R5F10PGJ,R5F10PLJ,R5F10PMJ,R5F10PPJ" Name="ROMEndAddress" Fixed="" Text="0003FFFF" /&gt;
@ -1657,17 +1662,17 @@
&lt;r_cg_timer.h UserName="r_cg_timer.h" LibName=".h" InUse="0" /&gt;
&lt;/TAU&gt;
&lt;WDT&gt;
&lt;r_cg_wdt.c UserName="r_cg_wdt.c" LibName=".c" InUse="0"&gt;
&lt;r_cg_wdt.c UserName="r_cg_wdt.c" LibName=".c" InUse="1"&gt;
&lt;Type R_WDT_Create="void R_WDT_Create(void)" R_WDT_Restart="void R_WDT_Restart(void)" /&gt;
&lt;R_WDT_Create UserName="R_WDT_Create" LibName="R_WDT_Create" InUse="0" Init="1" InitMode="" /&gt;
&lt;R_WDT_Restart UserName="R_WDT_Restart" LibName="R_WDT_Restart" InUse="0" /&gt;
&lt;R_WDT_Create UserName="R_WDT_Create" LibName="R_WDT_Create" InUse="1" Init="1" InitMode="" /&gt;
&lt;R_WDT_Restart UserName="R_WDT_Restart" LibName="R_WDT_Restart" InUse="1" /&gt;
&lt;/r_cg_wdt.c&gt;
&lt;r_cg_wdt_user.c UserName="r_cg_wdt_user.c" LibName="_user.c" InUse="0"&gt;
&lt;r_cg_wdt_user.c UserName="r_cg_wdt_user.c" LibName="_user.c" InUse="1"&gt;
&lt;Type R_WDT_Create_UserInit="void R_WDT_Create_UserInit(void)" r_wdt_interrupt="__interrupt static void r_wdt_interrupt(void)" /&gt;
&lt;R_WDT_Create_UserInit UserName="R_WDT_Create_UserInit" LibName="R_WDT_Create_UserInit" InUse="0" /&gt;
&lt;r_wdt_interrupt UserName="r_wdt_interrupt" INTHandle="" LibName="r_wdt_interrupt" InUse="0" /&gt;
&lt;/r_cg_wdt_user.c&gt;
&lt;r_cg_wdt.h UserName="r_cg_wdt.h" LibName=".h" InUse="0" /&gt;
&lt;r_cg_wdt.h UserName="r_cg_wdt.h" LibName=".h" InUse="1" /&gt;
&lt;/WDT&gt;
&lt;RTC&gt;
&lt;r_cg_rtc.c UserName="r_cg_rtc.c" LibName=".c" InUse="0"&gt;
@ -1897,7 +1902,7 @@
&lt;cg_ocd_trace_size Name="cg_ocd_trace_size" Value="512" /&gt;
&lt;cg_security8 Name="cg_security8" Value="00" /&gt;
&lt;cg_security4 Name="cg_security4" Value="00" /&gt;
&lt;wdt_option Name="wdt_option" Value="E9" /&gt;
&lt;wdt_option Name="wdt_option" Value="78" /&gt;
&lt;cg_crc_area Name="cg_crc_area" Value="00" /&gt;
&lt;cg_security3 Name="cg_security3" Value="00" /&gt;
&lt;cg_iawctl_value Name="cg_iawctl_value" Value="00" /&gt;
@ -1959,8 +1964,8 @@
&lt;TMRD0 SetFlag="False" MacroName="TMRD" Channel="0" TabEnable="True" /&gt;
&lt;TMRD1 SetFlag="False" MacroName="TMRD" Channel="1" TabEnable="True" /&gt;
&lt;/TAU&gt;
&lt;WDT Prepared="true" SetFlag="False" HelpID="watchdogtimer" NeedRefresh="False"&gt;
&lt;WDT SetFlag="False" MacroName="WDT" /&gt;
&lt;WDT Prepared="true" SetFlag="True" HelpID="watchdogtimer" NeedRefresh="False"&gt;
&lt;WDT SetFlag="True" MacroName="WDT" /&gt;
&lt;/WDT&gt;
&lt;RTC SetFlag="False" HelpID="rtc" NeedRefresh="False"&gt;
&lt;RTC MacroName="RTC" SetFlag="False" /&gt;
@ -3229,13 +3234,13 @@
&lt;/PortP15&gt;
&lt;/PORT&gt;
&lt;WDT&gt;
&lt;setting name="WDT_MODULE_USED" value="false" /&gt;
&lt;setting name="WDT_MODULE_UNUSE" value="true" /&gt;
&lt;setting name="WDT_MODULE_USED" value="true" /&gt;
&lt;setting name="WDT_MODULE_UNUSE" value="false" /&gt;
&lt;setting name="WDT_OVERFLOW_TIME" value="4" /&gt;
&lt;setting name="WDT_WINDOW_OPEN_TIME" value="2" /&gt;
&lt;setting name="WDT_HALT_STOP_OPERATION_ENABLE" value="true" /&gt;
&lt;setting name="WDT_HALT_STOP_OPERATION_STOP" value="false" /&gt;
&lt;setting name="WDT_INTERRUPT_USED" value="true" /&gt;
&lt;setting name="WDT_WINDOW_OPEN_TIME" value="0" /&gt;
&lt;setting name="WDT_HALT_STOP_OPERATION_ENABLE" value="false" /&gt;
&lt;setting name="WDT_HALT_STOP_OPERATION_STOP" value="true" /&gt;
&lt;setting name="WDT_INTERRUPT_USED" value="false" /&gt;
&lt;setting name="WDT_INTERRUPT_PRIORITY" value="3" /&gt;
&lt;/WDT&gt;
&lt;ADC&gt;

136
multical.temp.mtud

File diff suppressed because one or more lines are too long

28
owi.c

@ -1,4 +1,5 @@
#include "owi.h"
#include "r_cg_wdt.h"
#include "delay.h"
#include <string.h>
#include <stdio.h>
@ -18,6 +19,11 @@ static uint8_t g_owi_last_timeout_bit_index = 0xFFu;
static uint16_t g_owi_current_read_byte_index = 0u;
static uint8_t g_owi_current_read_bit_index = 0u;
static void OWI_KickWdt(void)
{
R_WDT_Restart();
}
/* =========================================================
* GPIO helpers (P70 / HW Open-Drain)
* - LOW : + 0
@ -117,6 +123,7 @@ void OWI_Init(uint32_t bit_time_us)
OWI_ClearTimeout();
GPIO_Input();
OWI_KickWdt();
}
/* =========================================================
@ -411,14 +418,20 @@ void OWI_T_CommandModeRaw(const uint8_t *tx_data, uint8_t tx_len, uint8_t id, ow
OWI_Init(OWI_BIT_PERIOD_US);
OWI_ClearTimeout();
OWI_KickWdt();
OWI_SecureStop();
OWI_KickWdt();
OWI_WriteByte((uint8_t)(id << 1));
OWI_KickWdt();
for (i = 0; i < (int)tx_len; i++) {
OWI_KickWdt();
OWI_WriteByte(tx_data[i]);
OWI_KickWdt();
}
OWI_Stop();
OWI_KickWdt();
owi_result_latch_timeout(r);
}
@ -430,14 +443,20 @@ void OWI_CommandModeRaw(const uint8_t *tx_data, uint8_t tx_len, uint8_t id, owi_
OWI_Init(OWI_BIT_PERIOD_US);
OWI_ClearTimeout();
OWI_KickWdt();
OWI_SecureStop();
OWI_KickWdt();
OWI_WriteByte((uint8_t)(id << 1));
OWI_KickWdt();
for (i = 0; i < (int)tx_len; i++) {
OWI_KickWdt();
OWI_WriteByte(tx_data[i]);
OWI_KickWdt();
}
OWI_Stop();
OWI_KickWdt();
owi_result_latch_timeout(r);
}
@ -467,24 +486,28 @@ void OWI_ReadBytesRaw(int length, uint8_t id, owi_io_result_t *r)
is_long_read = (length >= 119) ? 1u : 0u;
OWI_KickWdt();
OWI_SecureStop();
OWI_WriteByte((uint8_t)((id << 1) | 1u));
GPIO_ForceHighKick();
/* 기존 잘 되던 값 유지 */
delay_us(100u);
OWI_KickWdt();
/* 첫 falling edge를 한 번 잡는다 */
if (!OWI_WaitForFallingEdge(0u, 0u)) {
owi_result_latch_timeout(r);
OWI_StopRead();
OWI_KickWdt();
return;
}
for (i = 0; i < length; i++) {
OWI_KickWdt();
/* long read만 주기적 재동기화 */
if (is_long_read && i == (length - 50)) {
OWI_KickWdt();
if (!OWI_WaitForFallingEdge((uint16_t)i, 0u)) {
owi_result_latch_timeout(r);
break;
@ -500,6 +523,7 @@ void OWI_ReadBytesRaw(int length, uint8_t id, owi_io_result_t *r)
}
OWI_StopRead();
OWI_KickWdt();
}
void OWI_disable(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-04-13
* Creation Date: 2026-06-08
***********************************************************************************************************************/
/***********************************************************************************************************************

2
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-04-13
* Creation Date: 2026-06-08
***********************************************************************************************************************/
#ifndef CGC_H

2
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-04-13
* Creation Date: 2026-06-08
***********************************************************************************************************************/
/***********************************************************************************************************************

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-04-13
* Creation Date: 2026-06-08
***********************************************************************************************************************/
#ifndef STATUS_H

2
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-04-13
* Creation Date: 2026-06-08
***********************************************************************************************************************/
/***********************************************************************************************************************

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-04-13
* Creation Date: 2026-06-08
***********************************************************************************************************************/
#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-04-13
* Creation Date: 2026-06-08
***********************************************************************************************************************/
/***********************************************************************************************************************

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-04-13
* Creation Date: 2026-06-08
***********************************************************************************************************************/
/***********************************************************************************************************************

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-04-13
* Creation Date: 2026-06-08
***********************************************************************************************************************/
#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-04-13
* Creation Date: 2026-06-08
***********************************************************************************************************************/
/***********************************************************************************************************************

2
r_cg_userdefine.h

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

6
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-01-29
* Creation Date: 2026-06-08
***********************************************************************************************************************/
/***********************************************************************************************************************
@ -57,10 +57,6 @@ void R_WDT_Create(void)
{
WDTIMK = 1U; /* disable INTWDTI interrupt */
WDTIIF = 0U; /* clear INTWDTI interrupt flag */
/* Set INTWDTI low priority */
WDTIPR1 = 1U;
WDTIPR0 = 1U;
WDTIMK = 0U; /* enable INTWDTI interrupt */
}
/***********************************************************************************************************************

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-01-29
* Creation Date: 2026-06-08
***********************************************************************************************************************/
#ifndef WDT_H

15
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-01-29
* Creation Date: 2026-06-08
***********************************************************************************************************************/
/***********************************************************************************************************************
@ -38,7 +38,6 @@ Includes
/***********************************************************************************************************************
Pragma directive
***********************************************************************************************************************/
#pragma interrupt r_wdt_interrupt(vect=INTWDTI)
/* Start user code for pragma. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
@ -48,17 +47,5 @@ Global variables and functions
/* Start user code for global. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
/***********************************************************************************************************************
* Function Name: r_wdt_interrupt
* Description : This function is INTWDTI interrupt service routine.
* Arguments : None
* Return Value : None
***********************************************************************************************************************/
static void __near r_wdt_interrupt(void)
{
/* Start user code. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
}
/* Start user code for adding. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */

301
r_main.c

@ -23,7 +23,7 @@
* Device(s) : R5F10PPJ
* Tool-Chain : CCRL
* Description : This file implements main function.
* Creation Date: 2026-04-13
* Creation Date: 2026-06-08
***********************************************************************************************************************/
/***********************************************************************************************************************
@ -33,6 +33,7 @@ Includes
#include "r_cg_cgc.h"
#include "r_cg_port.h"
#include "r_cg_serial.h"
#include "r_cg_wdt.h"
/* Start user code for include. Do not edit comment generated here */
#include "common.h"
#include "gatectrl.h"
@ -55,7 +56,16 @@ Pragma directive
#define UART_RX_BUF_SIZE_LOCAL 1024
#define OWI_LONG_READ_SETTLE_US 30000U
#define OWI_LONG_READ_RETRY_US 10000U
#define OWI_CONNECT_SETTLE_US 2000U
#define POWER_STARTUP_SETTLE_MS 500U
#define START_RELAY_SETTLE_MS 1000U
#define GAUGE_RAW_NIBBLE_COUNT 24u
#define GAUGE_FRAME_NIBBLE_COUNT 13u
#define GAUGE_ALIGN_MAX_START 11
#define GAUGE_EDGE_TIMEOUT_US 30000U
#define GAUGE_STOP_SETTLE_MS 10U
#define GAUGE_START_SETTLE_MS 20U
#define GAUGE_DATA_SAMPLE_US 10U
volatile uint8_t uart_rx_done = 0;
volatile uint16_t uart_rx_index = 0;
volatile uint8_t uart_rx_buffer[UART_RX_BUF_SIZE] = {0};
@ -95,6 +105,18 @@ typedef struct {
uint8_t valid;
} gauge_state_t;
typedef struct {
const gauge_pins_t *pins;
gauge_state_t *state;
uint8_t active;
uint8_t ok;
uint8_t wait_state;
uint8_t bit_index;
uint8_t nibble_index;
uint8_t nibble;
uint32_t timeout_us;
} gauge_capture_t;
/* req, ck, data ¼ø¼­ */
static gauge_pins_t LEFT_GAUGE = {
&P15, &PM15, &PU15, 0x02u, /* REQ P15.1 */
@ -135,6 +157,21 @@ static void uart1_send_string_safe(const char *s)
}
}
static void app_kick_wdt(void)
{
R_WDT_Restart();
}
static void delay_ms_wdt(uint16_t total_ms)
{
while (total_ms != 0u) {
uint16_t step = (total_ms > 10u) ? 10u : total_ms;
delay_ms(step);
app_kick_wdt();
total_ms = (uint16_t)(total_ms - step);
}
}
static unsigned char hex2byte(char h, char l)
{
unsigned char hi, lo;
@ -296,8 +333,6 @@ static uint8_t gauge_read_aligned_frame(const gauge_pins_t *g, gauge_state_t *s)
{
int i;
int start;
char buf[96];
int p;
if (!g || !s) return 0u;
@ -366,6 +401,162 @@ static uint8_t gauge_decode_value(const uint8_t *n, float *value, int *decimal)
return 1u;
}
static void gauge_reset_state(gauge_state_t *s)
{
if (!s) return;
memset(s->rawBuf, 0, sizeof(s->rawBuf));
memset(s->frame, 0, sizeof(s->frame));
s->valid = 0u;
s->value = 0.0f;
s->decimal = 3;
}
static uint8_t gauge_align_captured_frame(gauge_state_t *s)
{
int i;
int start;
if (!s) return 0u;
for (start = 0; start <= GAUGE_ALIGN_MAX_START; start++) {
for (i = 0; i < (int)GAUGE_FRAME_NIBBLE_COUNT; i++) {
s->frame[i] = s->rawBuf[start + i];
}
if (gauge_is_valid_frame(s->frame)) {
return 1u;
}
}
return 0u;
}
static void gauge_capture_init(gauge_capture_t *c, const gauge_pins_t *g, gauge_state_t *s)
{
if (!c) return;
c->pins = g;
c->state = s;
c->active = (uint8_t)((g && s) ? 1u : 0u);
c->ok = 0u;
c->wait_state = 1u;
c->bit_index = 0u;
c->nibble_index = 0u;
c->nibble = 0u;
c->timeout_us = GAUGE_EDGE_TIMEOUT_US;
}
static void gauge_capture_step(gauge_capture_t *c)
{
if (!c || !c->active) return;
if (gauge_read_pin(c->pins->ck_p, c->pins->ck_mask) == (int)c->wait_state) {
if (c->wait_state) {
c->wait_state = 0u;
c->timeout_us = GAUGE_EDGE_TIMEOUT_US;
return;
}
delay_us(GAUGE_DATA_SAMPLE_US);
if ((*(c->pins->data_p)) & c->pins->data_mask) {
c->nibble |= (uint8_t)(1u << c->bit_index);
}
c->bit_index++;
if (c->bit_index >= 4u) {
c->state->rawBuf[c->nibble_index] = c->nibble;
c->nibble_index++;
c->nibble = 0u;
c->bit_index = 0u;
if (c->nibble_index >= GAUGE_RAW_NIBBLE_COUNT) {
c->active = 0u;
c->ok = 1u;
return;
}
}
c->wait_state = 1u;
c->timeout_us = GAUGE_EDGE_TIMEOUT_US;
return;
}
if (c->timeout_us == 0u) {
c->active = 0u;
c->ok = 0u;
return;
}
c->timeout_us--;
}
static uint8_t gauge_finish_captured_frame(const gauge_capture_t *c)
{
gauge_state_t *s;
if (!c || !c->state || !c->ok) return 0u;
s = c->state;
s->valid = 0u;
if (!gauge_align_captured_frame(s)) {
return 0u;
}
if (!gauge_decode_value(s->frame, &s->value, &s->decimal)) {
return 0u;
}
s->valid = 1u;
return 1u;
}
static uint8_t gauge_read_pair(const gauge_pins_t *left_g,
gauge_state_t *left_s,
const gauge_pins_t *right_g,
gauge_state_t *right_s)
{
gauge_capture_t left_cap;
gauge_capture_t right_cap;
uint8_t left_ok;
uint8_t right_ok;
if (!left_g || !left_s || !right_g || !right_s) return 0u;
gauge_reset_state(left_s);
gauge_reset_state(right_s);
gauge_req_stop(left_g);
gauge_req_stop(right_g);
delay_ms(GAUGE_STOP_SETTLE_MS);
gauge_req_start(left_g);
gauge_req_start(right_g);
delay_ms(GAUGE_START_SETTLE_MS);
gauge_capture_init(&left_cap, left_g, left_s);
gauge_capture_init(&right_cap, right_g, right_s);
while (left_cap.active || right_cap.active) {
gauge_capture_step(&left_cap);
gauge_capture_step(&right_cap);
if (left_cap.active || right_cap.active) {
delay_us(1u);
}
}
gauge_req_stop(left_g);
gauge_req_stop(right_g);
left_ok = gauge_finish_captured_frame(&left_cap);
right_ok = gauge_finish_captured_frame(&right_cap);
return (uint8_t)(left_ok && right_ok);
}
static uint8_t gauge_read(const gauge_pins_t *g, gauge_state_t *s)
{
if (!g || !s) return 0u;
@ -475,7 +666,14 @@ static void print_owi_write_result(const app_owi_result_t *r)
}
}
static void print_owi_read_result(const app_owi_result_t *r)
static void reset_channel_gate_defaults(uint8_t ch)
{
if (ch >= 1u && ch <= 20u) {
Gate_SetByNum(ch, 0u, 0u, 1u);
}
}
static void print_owi_read_result(const app_owi_result_t *r, uint8_t reset_ch)
{
char out[(2 * OWI_IO_MAX_BYTES) + 40];
uint16_t p = 0;
@ -485,6 +683,7 @@ static void print_owi_read_result(const app_owi_result_t *r)
if (!r || !r->ok || r->read_len == 0) {
out_print("Fail\r\n");
reset_channel_gate_defaults(reset_ch);
return;
}
@ -525,6 +724,7 @@ static void print_owi_read_result(const app_owi_result_t *r)
out[p++] = '\n';
out[p] = '\0';
out_print(out);
reset_channel_gate_defaults(reset_ch);
}
static void print_connect_sweep_result(uint8_t ch, uint8_t ok)
@ -586,13 +786,17 @@ static app_owi_result_t do_stable_owi_read(uint8_t id, uint16_t read_len)
if (is_long_owi_read_len(read_len)) {
delay_us(OWI_LONG_READ_SETTLE_US);
app_kick_wdt();
}
r = app_owi_read_basic(id, (int)read_len);
app_kick_wdt();
if ((!r.ok || r.timeout || r.read_len < read_len) && is_long_owi_read_len(read_len)) {
delay_us(OWI_LONG_READ_RETRY_US);
app_kick_wdt();
r = app_owi_read_basic(id, (int)read_len);
app_kick_wdt();
}
return r;
@ -726,6 +930,7 @@ static int run_connect_verify_one_channel(const app_job_t *job, uint8_t ch)
uint8_t write1_data[3];
uint8_t expected_tail[3];
uint8_t cmd_7c = 0x7Cu;
uint8_t attempt;
if (!job) return 0;
if (job->len != 6u) return 0;
@ -734,32 +939,71 @@ static int run_connect_verify_one_channel(const app_job_t *job, uint8_t ch)
memcpy(write1_data, &job->payload[0], 3u);
memcpy(expected_tail, &job->payload[3], 3u);
for (attempt = 0u; attempt < 2u; attempt++) {
if (attempt > 0u) {
Cal_Init();
app_kick_wdt();
}
Cal_Init();
Gate_SetByNum(ch, job->hash_on, job->anaout_on, job->check_on);
GateCtrl_SelectChannel(ch);
/* 1) first 3-byte write */
r_write1 = app_owi_write_t_basic(0x28u, write1_data, 3u);
if (!r_write1.ok || r_write1.timeout) return 0;
if (!r_write1.ok || r_write1.timeout) {
app_kick_wdt();
continue;
}
delay_us(OWI_CONNECT_SETTLE_US);
app_kick_wdt();
/* 2) read 2 bytes -> must be 72 72 */
r_read2 = app_owi_read_basic(0x28u, 2);
if (!r_read2.ok || r_read2.timeout || r_read2.read_len < 2u) return 0;
if (r_read2.data[0] != 0x72u || r_read2.data[1] != 0x72u) return 0;
if (!r_read2.ok || r_read2.timeout || r_read2.read_len < 2u ||
r_read2.data[0] != 0x72u || r_read2.data[1] != 0x72u) {
delay_us(OWI_CONNECT_SETTLE_US);
app_kick_wdt();
r_read2 = app_owi_read_basic(0x28u, 2);
}
if (!r_read2.ok || r_read2.timeout || r_read2.read_len < 2u) {
app_kick_wdt();
continue;
}
if (r_read2.data[0] != 0x72u || r_read2.data[1] != 0x72u) {
app_kick_wdt();
continue;
}
/* 3) write 7C */
r_write3 = app_owi_write_t_basic(0x28u, &cmd_7c, 1u);
if (!r_write3.ok || r_write3.timeout) return 0;
if (!r_write3.ok || r_write3.timeout) {
app_kick_wdt();
continue;
}
delay_us(OWI_CONNECT_SETTLE_US);
app_kick_wdt();
/* 4) read 3 bytes -> compare with 7C 78 01 */
/* 4) read 3 bytes -> compare with expected tail */
r_read3 = app_owi_read_basic(0x28u, 3);
if (!r_read3.ok || r_read3.timeout || r_read3.read_len < 3u) return 0;
if (memcmp(r_read3.data, expected_tail, 3u) != 0) return 0;
if (!r_read3.ok || r_read3.timeout || r_read3.read_len < 3u ||
memcmp(r_read3.data, expected_tail, 3u) != 0) {
delay_us(OWI_CONNECT_SETTLE_US);
app_kick_wdt();
r_read3 = app_owi_read_basic(0x28u, 3);
}
if (!r_read3.ok || r_read3.timeout || r_read3.read_len < 3u) {
app_kick_wdt();
continue;
}
if (memcmp(r_read3.data, expected_tail, 3u) == 0) {
return 1;
}
}
}
return 0;
}
static int execute_connect_verify_sequence(const app_job_t *job)
{
uint8_t ch;
@ -844,6 +1088,7 @@ static int execute_direct_read_sequence(const app_job_t *job)
} else {
out_print("Fail\r\n");
}
reset_channel_gate_defaults(job->channel);
return 1;
read_len = 23u;
} else {
@ -853,6 +1098,7 @@ static int execute_direct_read_sequence(const app_job_t *job)
r_write = app_owi_write_basic(0x28u, job->payload, 3u);
if (!r_write.ok || r_write.timeout) {
out_print("Fail\r\n");
reset_channel_gate_defaults(job->channel);
send_end_response();
return 1;
}
@ -860,11 +1106,12 @@ static int execute_direct_read_sequence(const app_job_t *job)
r_read = do_stable_owi_read(0x28u, read_len);
if (!r_read.ok || r_read.timeout || r_read.read_len < read_len) {
out_print("Fail\r\n");
reset_channel_gate_defaults(job->channel);
send_end_response();
return 1;
}
print_owi_read_result(&r_read);
print_owi_read_result(&r_read, job->channel);
send_end_response();
return 1;
}
@ -919,7 +1166,7 @@ static int execute_owi_service_from_job(const app_job_t *job)
if (job->type == APP_JOB_PROTO_OR) {
r = app_owi_read_basic(job->id, (int)job->len);
print_owi_read_result(&r);
print_owi_read_result(&r, job->channel);
send_end_response();
return 1;
}
@ -1029,7 +1276,7 @@ static void process_local_legacy_line(const char *input_line)
Cal_Init();
GateCtrl_SelectChannel(1u);
r = app_owi_read_basic(id, (int)byte_len);
print_owi_read_result(&r);
print_owi_read_result(&r, 1u);
send_end_response();
}
@ -1058,10 +1305,16 @@ static void process_one_line(app_cmd_src_t src, const volatile uint8_t *rx_buf,
relay_on();
delay_ms(15000U);
delay_ms_wdt(15000U);
if (!gauge_read_pair(&LEFT_GAUGE, &leftGauge, &RIGHT_GAUGE, &rightGauge)) {
if (!leftGauge.valid) {
gauge_read(&LEFT_GAUGE, &leftGauge);
}
if (!rightGauge.valid) {
gauge_read(&RIGHT_GAUGE, &rightGauge);
}
}
gauge_format_value(leftBuf, sizeof(leftBuf), "L:", &leftGauge);
gauge_format_value(rightBuf, sizeof(rightBuf), "R:", &rightGauge);
@ -1069,9 +1322,9 @@ static void process_one_line(app_cmd_src_t src, const volatile uint8_t *rx_buf,
sprintf(lineBuf, "%s,%s\r\n", leftBuf,rightBuf);
out_print(lineBuf);
delay_ms(START_RELAY_SETTLE_MS);
delay_ms_wdt(START_RELAY_SETTLE_MS);
do_nvm_read_after_gauge();
delay_ms(100u);
delay_ms_wdt(100u);
send_end_response();
return;
}
@ -1145,6 +1398,11 @@ void main(void)
{
R_MAIN_UserInit();
/* Start user code. Do not edit comment generated here */
R_WDT_Create();
R_WDT_Restart();
delay_ms_wdt(POWER_STARTUP_SETTLE_MS);
relay_init();
gauge_setup_pins(&LEFT_GAUGE);
@ -1157,6 +1415,8 @@ void main(void)
app_scheduler_init();
runtime_reset();
Cal_Init();
uart1_send_string_safe("BOOT single-mode\r\n");
uart_rx_done = 0;
@ -1167,6 +1427,8 @@ void main(void)
while (1U)
{
app_kick_wdt();
if (uart_rx_done) {
process_one_line(APP_CMD_SRC_PC, uart_rx_buffer, uart_rx_length);
uart_rx_done = 0;
@ -1175,6 +1437,7 @@ void main(void)
R_UART1_Receive((uint8_t *)&uart_rx_buffer[0], 1);
}
app_job_tick();
app_kick_wdt();
}
/* End user code. Do not edit comment generated here */
}

4
r_systeminit.c

@ -23,7 +23,7 @@
* Device(s) : R5F10PPJ
* Tool-Chain : CCRL
* Description : This file implements system initializing function.
* Creation Date: 2026-04-13
* Creation Date: 2026-06-08
***********************************************************************************************************************/
/***********************************************************************************************************************
@ -33,6 +33,7 @@ Includes
#include "r_cg_cgc.h"
#include "r_cg_port.h"
#include "r_cg_serial.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 */
#include "r_cg_userdefine.h"
@ -73,6 +74,7 @@ void R_Systeminit(void)
R_SAU0_Create();
R_SAU1_Create();
R_IICA0_Create();
R_WDT_Create();
/* Set invalid memory access detection control */
IAWCTL = 0x00U;

Loading…
Cancel
Save