developing IO Drivers for MQX

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

developing IO Drivers for MQX

1,134 Views
private_hell
Contributor I

Hi

 

im following thru Application note AN3902 or creating IO drivers for MQX. Im trying to create the random number generator as per part 4 of the note, however when i go to make the program i get the follow error: illegal argument list - io_rng.h line 14 #define MINIMUM_AMOUNT_OF_BYTES(4)

 

now im puzzled why this is coming up as it is copied directly from the application note. the code is:

 

#ifndef __RNG_DRIVER__
#define __RNG_DRIVER__

#include "ioctl.h"

typedef struct rng_struct
{
    uint_32 rng_max_value;
    uint_32 rng_min_value;
} RNG_STRUCT, _PTR_ RNG_DRIVER_STRUCT_PTR;

typedef volatile struct rng_struct _PTR_VRNG_STRUCT_PTR;

#define MINIMUM_AMOUNT_OF_BYTES(4)


#define IO_IOCTL_RNG_SET_MAX_VALUE        _IO(IO_TYPE_RNG,0x01)
#define IO_IOCTL_RNG_SET_MIN_VALUE        _IO(IO_TYPE_RNG,0x02)
#define IO_IOCTL_RNG_SET_NUMBER_SIZE    _IO(IO_TYPE_RNG,0x03)

#ifdef __cplusplus
extern "c"
{
    #endif
  
    extern _mqx_int _io_rng_install (char_ptr identifier);
    #ifdef __cplusplus
}
#endif

#endif

 

 

 

 with the line causing he problem highlighted in red. Does anyone know what could be causing this? im currently using MQX 3.2.

 

cheers

jase

Message Edited by private_hell on 2009-10-27 12:47 AM
0 Kudos
3 Replies

405 Views
MQXuser
Contributor III

Hi,

 

I think that error is cause by the lack of a space between the MINIMUM_AMOUNT_OF_BYTES  and the  (4)

 

Try to put it as follows and see what happens

#define MINIMUM_AMOUNT_OF_BYTES (4)

 

0 Kudos

405 Views
private_hell
Contributor I

cheers that seems to have fixed that problem - however a new problem has appeared. in my rng_task file after setting up the IO commands (open, close, read, write and ioctl) and the install command it hits the following line and complains about an undefined indentifier 'rng_range_struct' : (highlighted in red where the error occurs)

 

 

_mqx_int _io_rng_open(FILE_PTR fd_ptr, char_ptr open_name_ptr, char_ptr flags)
{
 VMCF5225_STRUCT_PTR reg_ptr = (VMCF5225_STRUCT_PTR)BSP_IPSBAR;
 rng_range_struct.rng_max_value = 0xFFFFFFFF;
 rng_range_struct.rng_min_value = 0;

 reg_ptr->RNG.RNGCR |= MCF5225_RNG_RNGCR_GO;

 return(IO_OK);
}

 i have added the lines to the ioctl.h to define the IO type :

 

#define IO_TYPE_PCCARD             0x09
#define IO_TYPE_PCFLASH            0x0A
#define IO_TYPE_PIPE               0x0B
#define IO_TYPE_QSPI               0x0C
#define IO_TYPE_SERIAL             0x0D
#define IO_TYPE_SPI                0x0E
#define IO_TYPE_USBMFS             0x0F
#define IO_TYPE_TFS                0x10
#define IO_TYPE_RNG     0x11

 however it hasnt turned the pale blue that the other define device types have so i have a feeling that this is what is causing the undefined indentifier error. So have i missed adding something in the ioctl.h file.

 

cheers

 

 

 

 

Message Edited by private_hell on 2009-10-28 10:57 PM
Message Edited by private_hell on 2009-10-28 10:58 PM
0 Kudos

405 Views
JuroV
NXP Employee
NXP Employee

undefined indentifier 'rng_range_struct' means, that compiler does not know what 'rng_range_struct' is

please concentrate to fix that problem

0 Kudos