Skip to content

Range error in spidev #11

Description

@MarkMLl

On a 64-bit system, this function generates a range error if processing an _IOC_READ. Because SizeInt and TIOCtlRequest are defined at the system level, the best fix appears to be disabling the range check for the duration of the computation.

function _IOC(dir, _type, nr: Longword; size: SizeInt): TIOCtlRequest; begin {$push }{$R- } // If dir is 2 (_IOC_READ) this will set the MSB hence a range error _IOC := (dir shl _IOC_DIRSHIFT) or (_type shl _IOC_TYPESHIFT) or (nr shl _IOC_NRSHIFT) or (size shl _IOC_SIZESHIFT); {$pop } end;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions