Skip to content

Commit 9c3a382

Browse files
authored
Updating comments
1 parent e473f56 commit 9c3a382

File tree

1 file changed

+0
-58
lines changed
  • niosv_c/niosv_c_helloworld_ocm_mem_test/sources/sw/app

1 file changed

+0
-58
lines changed

niosv_c/niosv_c_helloworld_ocm_mem_test/sources/sw/app/main.c

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,6 @@
77

88
#define OCM_BASE INTEL_ONCHIP_MEMORY_0_BASE
99

10-
#if 0
11-
// Using usleep as the delay function
12-
int usleep(useconds_t usec);
13-
14-
// Function to test PIO functionality
15-
int pio_test()
16-
{
17-
int count = 0;
18-
int i;
19-
int pio_err = 0;
20-
printf("Application to toggle the PIOs- [4:0] \n");
21-
22-
while (count < 64)
23-
{
24-
i = count & 0xf;
25-
26-
// Write data to the PIO register at base address PIO_0_BASE
27-
IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, count & 0xf);
28-
29-
// Introduce a short delay
30-
usleep(100);
31-
32-
// Read back data from the PIO register
33-
printf("DATA READBACK FROM PIO_0_BASE is 0x%x \n", IORD_ALTERA_AVALON_PIO_DATA(PIO_0_BASE));
34-
35-
// Verify if the written data matches the read data
36-
if (i != IORD_ALTERA_AVALON_PIO_DATA(PIO_0_BASE))
37-
{
38-
printf("Data MISMATCH - TEST FAILED \n");
39-
pio_err = pio_err + 1;
40-
}
41-
else
42-
{
43-
printf("DATA MATCHED - TEST PASSED \n");
44-
}
45-
count++;
46-
}
47-
return pio_err;
48-
}
49-
#endif
50-
5110
int main()
5211
{
5312
int p;
@@ -88,23 +47,6 @@ int main()
8847

8948
printf("Memory Test Complete \n");
9049

91-
#if 0
92-
int pio_fail_flag;
93-
94-
// Run the PIO test function
95-
pio_fail_flag = pio_test();
96-
97-
// Check the result of the PIO test
98-
if (pio_fail_flag != 0)
99-
{
100-
printf("NIOSV-PIO Test failed with PIO_ERR = %d\n", pio_fail_flag);
101-
}
102-
else
103-
{
104-
printf("NIOSV-PIO Test PASSED \n");
105-
}
106-
#endif
107-
10850
// Read and print the System ID from the peripheral core
10951
printf("Print the value of System ID \n");
11052
sys_id = IORD_ALTERA_AVALON_SYSID_QSYS_ID(SYSID_QSYS_0_BASE); // Read System ID from the Qsys system ID peripheral

0 commit comments

Comments
 (0)