Everything

Editing the Program

2. Editing

Edit the program following the steps listed below.

 

Double-click " r_cg_main.c " in the Project Tree.

 

Copy the following text and paste it to the section of r_cg_main.c shown in the figure below.

 

R_CMT0_Start();

 

 

Double-click " r_cg_cmt_user.c " in the Project Tree.

Copy the following texts and paste them to the sections of r_cg_cmt_user.c shown in the figure below.

 

uint16_t  g_count;

 

uint16_t  inreg = 0,outreg = 0;

g_count++;

inreg = PORTA.PDR.BIT.B0;

outreg = inreg  ^  1;

PORTA.PDR.BIT.B0 = outreg;

PORTB.PDR.BIT.B7 = inreg;