Go to advanced search

by PeterO
Sun May 27, 2018 8:00 am
Forum: Beginners
Topic: python not run from terminal
Replies: 9
Views: 151

Re: python not run from terminal

Does it give an error message ?
PeterO
by PeterO
Sun May 27, 2018 7:24 am
Forum: The Pi Store
Topic: MPEG2 Patent expires this month
Replies: 19
Views: 5082

Re: MPEG2 Patent expires this month

RichardS wrote:
Sun May 27, 2018 6:41 am
I am sensitive to the fact that the mods and representatives of the Pi Foundation have requested not to have further open discussion of this topic here in the forum
Clearly you are NOT sensitive to this request because here you are banging on about it yet again....
PeterO
by PeterO
Sun May 27, 2018 5:48 am
Forum: Troubleshooting
Topic: High CPU usage when booting from USB
Replies: 15
Views: 698

Re: High CPU usage when booting from USB

If so, that seems very strange doesn't it? I wonder what kind of info do you suppose it's trying to log? It's not logging, it's polling the sd slot to see it you've inserted an sd card. If you USB boot you can hot plug sd-cards but I believe the PI doesn't use a "card inserted" physical switch so t...
by PeterO
Thu May 24, 2018 6:40 pm
Forum: General discussion
Topic: Why does the RPF care about how many desktops I have ?
Replies: 12
Views: 675

Re: Why does the RPF care about how many desktops I have ?

As I've said before no other distribution takes this approach.
PeterO
by PeterO
Thu May 24, 2018 5:59 pm
Forum: C/C++
Topic: How to record mouse data and remove cursor/button functionality
Replies: 21
Views: 419

Re: How to record mouse data and remove cursor/button functionality

The code I posted earlier viewtopic.php?f=33&t=213801#p1317163 reads the event stream and interprets them.

PeterO
by PeterO
Thu May 24, 2018 2:50 pm
Forum: General discussion
Topic: Why does the RPF care about how many desktops I have ?
Replies: 12
Views: 675

Why does the RPF care about how many desktops I have ?

Why do the foundation graphics mods set the number of desktops back to one every time ?

Does it somehow offend them that I set it to three desktops ?

Please, stop needlessly messing around with user's settings and configurations.

PeterO
by PeterO
Thu May 24, 2018 11:40 am
Forum: C/C++
Topic: How to record mouse data and remove cursor/button functionality
Replies: 21
Views: 419

Re: How to record mouse data and remove cursor/button functionality

In my openGLES code I look for a file that ends with "event-mouse" in "/dev/input/by-id", so it normally finds the file for my tracker ball which is : /dev/input/by-id/usb-Logitech_USB_Trackball-event-mouse which is in turn a link to /dev/input/mouse0 In your case I expect it will be /dev/input/mou...
by PeterO
Thu May 24, 2018 11:28 am
Forum: C/C++
Topic: How to record mouse data and remove cursor/button functionality
Replies: 21
Views: 419

Re: How to record mouse data and remove cursor/button functionality

I've looked at your code now, an you are not using the event devices so I can't really say if it should work or not. Your code opens the file /dev/input/mouse[0,1] My code is written to use /dev/input/event[0,3] which provide a stream of event structures rather than the old style mouse driver emulat...
by PeterO
Wed May 23, 2018 8:00 pm
Forum: General discussion
Topic: Special-case power requirements
Replies: 11
Views: 340

Re: Special-case power requirements

As the time frame that the "rf kill switch" occurs in the boot sequence is much longer than even multiple passes down the 20' transmission line, I think it a much more likely scenario for the actual failure. OP wrote the Pi goes into a reboot cycle (starts as normal, gets to a line that says someth...
by PeterO
Wed May 23, 2018 6:32 pm
Forum: Off topic discussion
Topic: Front panel program?
Replies: 21
Views: 923

Re: Front panel program?

I've been working on this again ... https://www.youtube.com/watch?v=3zezUiJ8NI8
Currently I'm getting to grips with Blender to fully model the console.
PeterO
by PeterO
Wed May 23, 2018 3:27 pm
Forum: C/C++
Topic: Odd happenings at 32 and 64 bits
Replies: 29
Views: 498

Re: Odd happenings at 32 and 64 bits

If you have enough warnings turned on gcc will tell you something about the problem shift.c: In function ‘main’: shift.c:17:13: warning: conversion to ‘uint64_t’ from ‘int’ may change the sign of the result [-Wsign-conversion] out = 1 << shft; Note that was produced by gcc (Ubuntu 4.8.4-2ubuntu1~14....
by PeterO
Wed May 23, 2018 7:35 am
Forum: General discussion
Topic: Special-case power requirements
Replies: 11
Views: 340

Re: Special-case power requirements

20 feet of wire will have significant inductance and capacitance causing it to act line a transmission line. Any rapid changes in current might cause voltage spikes (either up or down) to travel up the line to the PSU and then to be reflected back to the PI. Adding capacitance at the PI end is a goo...
by PeterO
Wed May 23, 2018 6:25 am
Forum: C/C++
Topic: How to record mouse data and remove cursor/button functionality
Replies: 21
Views: 419

Re: How to record mouse data and remove cursor/button functionality

Can you put all your code somewhere ? I can plug two mice into a PI and try your code to see what is going on.

PeterO
by PeterO
Tue May 22, 2018 5:59 pm
Forum: General programming discussion
Topic: Making readable modifyable code.
Replies: 284
Views: 32768

Re: Making readable modifyable code.

thinkpad:Desktop simon$ clang -c -std=c99 -Wall -Wunused-argument -Werror -o foo.o foo.c thinkpad:Desktop simon$[/code] Nowhere near enough warnings enabled for a "clean compile" test... :D After a discussion on here some months ago I now use this set in all my projects. -std=gnu99 -Wall -Wextra -W...
by PeterO
Tue May 22, 2018 4:53 pm
Forum: General programming discussion
Topic: Making readable modifyable code.
Replies: 284
Views: 32768

Re: Making readable modifyable code.

// Not guaranteed 100% correct, but very simple and efficient. float average(float * values, int count) { return 4; } In modern C that should be written float average(int count,float values[count]) { return 3.2; } which is simpler because it avoids the explicit use of pointers. It is also more corr...
by PeterO
Tue May 22, 2018 12:51 pm
Forum: General discussion
Topic: STICKY: PMs being turned off from June 13
Replies: 22
Views: 859

Re: STICKY: PMs being turned off from June 13

If this were really the reason, then the PM system would have been turned off from the start ! Oh, please. All software comes with default settings that most people leave alone unless they need to change them. In the case of this forum, the RPF simply decided that now is a good time to make that ch...
by PeterO
Tue May 22, 2018 5:29 am
Forum: General discussion
Topic: STICKY: PMs being turned off from June 13
Replies: 22
Views: 859

Re: STICKY: PMs being turned off from June 13

rpdom wrote:
Tue May 22, 2018 5:25 am

Unless PM is disabled, anyone could message them and the Foundation don't want to get caught out for allowing someone bad sending wrong messages to a kid. This is understandable.
If this were really the reason, then the PM system would have been turned off from the start !
PeterO
by PeterO
Fri May 18, 2018 10:00 pm
Forum: C/C++
Topic: How to record mouse data and remove cursor/button functionality
Replies: 21
Views: 419

Re: How to record mouse data and remove cursor/button functionality

Yes you will have to read events from the file you opened... Here is the code I use... My main program loop calls "mouseMotion" which reads the evens and set the appropriate global variables (mouseMoveLR and mouseMoveUD) to reflect the mouse movements since the function was last called. It will try ...
by PeterO
Fri May 18, 2018 9:32 pm
Forum: C/C++
Topic: How to record mouse data and remove cursor/button functionality
Replies: 21
Views: 419

Re: How to record mouse data and remove cursor/button functionality

Thanks for all your help so far, maybe I could bother you just a little more? So I'm now using ioctl on the mousefd. Looks something like this: fd1 = open(mouse1, O_RDWR); if(fd1 == -1) {return -1} //mute mouse1 result = ioctl(fd1, EVIOCGRAB, 1); if(result == -1) { printf("Muting broke. %s\n", stre...
by PeterO
Fri May 18, 2018 5:02 pm
Forum: C/C++
Topic: How to record mouse data and remove cursor/button functionality
Replies: 21
Views: 419

Re: How to record mouse data and remove cursor/button functionality

It's in /usr/include/linux/input.h so you'll need to "#include linux/input.h".

PeterO
by PeterO
Fri May 18, 2018 4:47 pm
Forum: C/C++
Topic: How to record mouse data and remove cursor/button functionality
Replies: 21
Views: 419

Re: How to record mouse data and remove cursor/button functionality

Thank you for the reply, that was very helpful! Just to be clear, ioctl with the EVIOCGRAB tag will not pass the events to X? I'm having a hard time finding documentation for EVIOCGRAB, the man page for ioctl and ioctl_list doesn't seem to describe it, so I don't really know what that tag does. I'l...
by PeterO
Fri May 18, 2018 4:21 pm
Forum: C/C++
Topic: How to record mouse data and remove cursor/button functionality
Replies: 21
Views: 419

Re: How to record mouse data and remove cursor/button functionality

If you open the "non-X-mouse" file in /dev/input and set it for "exclusive access" in your program the events will not be passed on to X while your program has it open.... result = ioctl(mouseFd, EVIOCGRAB, 1); Also "evtest" is a useful tool to use when trying to learn about the events that come fro...
by PeterO
Thu May 17, 2018 9:30 pm
Forum: C/C++
Topic: gcc xprintf nan bug librtlsdr
Replies: 15
Views: 364

Re: gcc xprintf nan bug librtlsdr

You did say "I have a modified rtl_power version, moving around some global variables into functions" so maybe it is your fault ? But if you still think it's a bug then you need to raise a bug on the librtlsdr github site, they are the people that you should be talking to. I used the original rtl_p...
by PeterO
Thu May 17, 2018 8:56 pm
Forum: C/C++
Topic: gcc xprintf nan bug librtlsdr
Replies: 15
Views: 364

Re: gcc xprintf nan bug librtlsdr

Its not my own program, its librtlsdr and its example programs. You did say "I have a modified rtl_power version, moving around some global variables into functions" so maybe it is your fault ? But if you still think it's a bug then you need to raise a bug on the librtlsdr github site, they are the...
by PeterO
Thu May 17, 2018 4:37 pm
Forum: C/C++
Topic: gcc xprintf nan bug librtlsdr
Replies: 15
Views: 364

Re: gcc xprintf nan bug librtlsdr

Are you sure the value of dbm is greater than zero before taking the log ?

Manual page for log says

Code: Select all

    If  x  is  negative  (including negative infinity), then a domain error
       occurs, and a NaN (not a number) is returned.
PeterO

Go to advanced search