Go to advanced search

by Paeryn
Fri Nov 26, 2021 7:11 pm
Forum: General
Topic: Does CMAKE prevent by-function optimisations ?
Replies: 19
Views: 615

Re: Does CMAKE prevent by-function optimisations ?

Though there is an extra encoding of MOV which lets you move from a low register (R0-R7) to any of the registers (R0-R12) but I can't see an encoding to move from a high register to a low register. It is from any (4-bit regnum) to any (4-bit regnum). The encoding is a little weird, Rd is not a cont...
by Paeryn
Fri Nov 26, 2021 2:57 am
Forum: General
Topic: Does CMAKE prevent by-function optimisations ?
Replies: 19
Views: 615

Re: Does CMAKE prevent by-function optimisations ?

What I would expect to happen is output_bit_pt_reload is assigned to an unused register such as r8, and when the reload is needed at address 200000e6 it would perform a mov r4, r8. The compiler can't store a value in register R8 because there is no such register. The Thumb instruction set only has ...
by Paeryn
Sun Nov 21, 2021 11:05 pm
Forum: C/C++
Topic: Why no warning?
Replies: 46
Views: 1917

Re: Why no warning?

-Wconversion implies -Wfloat-conversion (if a real looses precision e.g. double to float or float to int), and for C (but not C++) also implies -Wsign-conversion (the sign could be lost e.g. signed integer to unsigned integer). My experience is that the most irritating conversion is when C silently...
by Paeryn
Sun Nov 21, 2021 10:32 pm
Forum: General discussion
Topic: I need to hack a Pi4
Replies: 32
Views: 1429

Re: I need to hack a Pi4

(Added code tags in the quote to make it easier to read the fields) Comparing shadow the previous one I adviced there aren't more the :18439:0:99999:7::: after the hash, I don't know what they are useful to. In a line of /etc/shadow there are multiple fields separated by colons and are: Username. Th...
by Paeryn
Sun Nov 21, 2021 4:39 am
Forum: C/C++
Topic: Why no warning?
Replies: 46
Views: 1917

Re: Why no warning?

It's not an error as C uses implicit casts when the basic numeric types don't match and gcc doesn't warn you by default because (a) it's perfectly valid C and (b) it's common to rely on it (especially in older code). You have to tell gcc that you want warnings about implicit conversions (-Wconversio...
by Paeryn
Thu Nov 18, 2021 2:10 pm
Forum: Bare metal, Assembly language
Topic: AARCH64 context saving question
Replies: 2
Views: 162

Re: AARCH64 context saving question

To quote Arm themselves, "For AArch64, sp must be 16-byte aligned whenever it is used to access memory. This is enforced by AArch64 hardware." So if you try to only decrement the stack by 8 for a single register push then the next push will fail.
by Paeryn
Wed Nov 17, 2021 8:25 pm
Forum: C/C++
Topic: C++: extension of a class (e.g., string class)
Replies: 36
Views: 1168

Re: C++: extension of a class (e.g., string class)

:shock: tbh, sounds as if inheritance of classes in C++ is not worth much :? :roll: (If I want to inherit a class, I of course want complete inheritance) As mentioned before, classes like std::string aren't meant to be inherited by anything, just because classes can inherit other classes doesn't me...
by Paeryn
Wed Nov 17, 2021 6:23 pm
Forum: C/C++
Topic: C++: extension of a class (e.g., string class)
Replies: 36
Views: 1168

Re: C++: extension of a class (e.g., string class)

so this is now a new version for debugging, but it strangely fails when assigning char* string values to stringX variables (other than to native string variables) - but as the stringX class is supposed to expand the string class by inheritance I had expected it to work as well: #include <stdio.h> #...
by Paeryn
Wed Nov 10, 2021 2:17 am
Forum: OpenGLES
Topic: Geometry Shaders
Replies: 4
Views: 295

Re: Geometry Shaders

I included gl32.h which allowed me to access the GL_GEOMETRY_SHADER value and was able to compile shaders and link them imto a PO, but not tested the result in anger yet.. Im thinking theres another way though including gl32.h when we don't have gl32 is a bit worrying? As geometry shaders in ES3.1 ...
by Paeryn
Sat Nov 06, 2021 7:29 pm
Forum: SDK
Topic: Fedora 35 (gcc 11.2)
Replies: 5
Views: 298

Re: Fedora 35 (gcc 11.2)

What's the exact command line being executed when these errors happen? g++ has never had an option --wrap . Command line options like --wrap=hypotf are meant for the linker, gcc (g++) should be being given the option prefixed with -Wl, to tell it to pass the option to the linker. Gcc doesn't attempt...
by Paeryn
Thu Nov 04, 2021 6:57 pm
Forum: Python
Topic: Syntax for isinstance()
Replies: 2
Views: 115

Re: Syntax for isinstance()

The second parameter is simply the type that you are wanting to check against

Code: Select all

if isinstance(p, omxplayer.player.OMXPlayer):
    print('p is an omxplayer object that we can use')
else:
    print('p is some other object that we can't use')
by Paeryn
Wed Oct 20, 2021 10:13 pm
Forum: Troubleshooting
Topic: Compile failed
Replies: 2
Views: 231

Re: Compile failed

From those errors, the system include file time.h hasn't been included by the time the compiler reached those lines. Because of that: struct timespec hasn't been declared hence all the errors about it being declared in the functions' parameter lists and the attempted uses of those variables that hav...
by Paeryn
Mon Oct 18, 2021 1:27 pm
Forum: Troubleshooting
Topic: Firmware erratum workaround
Replies: 6
Views: 311

Re: Firmware erratum workaround

IIRC you can get the firmware to load a custom armstub where you could put such an instruction, that code is the very first thing the cpu executes. I think the firmware will automatically load armstub8-32.bin (or armstub8-64.bin if it's loading a 64 bit kernel) for the RPi4 if it's present in the bo...
by Paeryn
Wed Oct 06, 2021 10:20 pm
Forum: General discussion
Topic: Error: Unable to locate package
Replies: 6
Views: 571

Re: Error: Unable to locate package

You can't use apt to uninstall something that apt didn't install in the first place, apt can't be expected to know anything about what apt wasn't involved in. Hopefully you've still got the build directory around and that the Makefile that built & installed fldigi also has a rule for uninstallin...
by Paeryn
Tue Oct 05, 2021 3:38 pm
Forum: Python
Topic: How does thonyy IDE show an unrecognized word?
Replies: 6
Views: 468

Re: How does thonyy IDE show an unrecognized word?

import RPi.GPIO as GPIO import time button=16 led=40 GPIO.setmode(GPIO.BOARD) pins=[40,38,37,36,35] GPIO.setup(button,GPIO.IN) for i in pinler: GPIO.setup(i,GPIO.OUT) try: while True: if GPIO.input(button)==GPIO.HIGH: #When you type button instead of button ?????? GPIO.output(led,GPIO.HIGH) else: G...
by Paeryn
Sat Oct 02, 2021 8:01 pm
Forum: General discussion
Topic: Cron Job not Running
Replies: 10
Views: 370

Re: Cron Job not Running

are you sure you want to be creating /var/log/cron.log (> as you have it) rather than appending to it (using >>)? i would recommend creating your own file, dont touch the existing one I'm sure cron's own log file will just be called /var/log/cron and not /var/log/cron.log but I'm not at home to che...
by Paeryn
Sat Oct 02, 2021 7:47 pm
Forum: General discussion
Topic: Cron Job not Running
Replies: 10
Views: 370

Re: Cron Job not Running

If you've added that to root's crontab then remove sudo as it is superfluous, and are you sure you want to be creating /var/log/cron.log ( > as you have it) rather than appending to it (using >> )? Edit: I can't remember off the top of my head if cron writes to that log file itself , if it does then...
by Paeryn
Tue Sep 21, 2021 10:23 pm
Forum: Python
Topic: one element delay in loop
Replies: 4
Views: 509

Re: one element delay in loop

I don't really understand what u meant with indentations in python code, could you explain it little more? If you look at your post there is no indentation present in the Python code at all. Python depends on indentation to delimit blocks of code, for example in your post you have this... while Tru...
by Paeryn
Tue Sep 21, 2021 6:00 pm
Forum: Python
Topic: one element delay in loop
Replies: 4
Views: 509

Re: one element delay in loop

The code you posted is not valid Python because you haven't got any indentation where indentation is required. Also you use GPIO but at no point has GPIO been defined/imported. I don't think you want to "delay" the print as that would have unwanted implications. I think what you want is to...
by Paeryn
Sat Sep 18, 2021 9:29 pm
Forum: Python
Topic: indentation problem
Replies: 23
Views: 1509

Re: indentation problem

Just to add as well, those if statements have an overlapping range in that you test for a value being >= 28 then if that fails you test if the value is <= 28. The elif test will not happen unless the value is < 28 (the if condition guarantees it) so you know the elif won't be attempted when the valu...
by Paeryn
Sat Sep 18, 2021 3:00 pm
Forum: Python
Topic: indentation problem
Replies: 23
Views: 1509

Re: indentation problem

Sorry everyone , i stuffed up again but can not see where. the relays are not functioning as they should based on temperatures. myTempCab = curTemp cab = (" Cabin= " + str(myTempCab) + "*C") if cab >= str(28): #turns compressor on over 24*C bus.write_byte_data(DEVICE_ADDR, 3, 0x...
by Paeryn
Tue Sep 14, 2021 4:01 pm
Forum: C/C++
Topic: C scripts / C++ scripts
Replies: 17
Views: 2250

Re: C scripts

You might want to change the call to sprintf() into a call to snprintf() to prevent a possible buffer overflow // limit the number of chars written to the size of the buffer snprintf( cmds, siz, "bash -c \"%s\"", s ); Though you'll also want to either make sure the whole string w...
by Paeryn
Tue Sep 14, 2021 1:29 pm
Forum: MicroPython
Topic: MicroPython double precision
Replies: 28
Views: 1700

Re: MicroPython double precision

I personally don't like to see -fsingle-precision-constant used, to me it's as bad as -fsigned-char or -funsigned-char in that I see them as bodges to fix incorrectly written code (although single-precision-constant is listsd as an optimisation flag).
by Paeryn
Mon Sep 13, 2021 10:33 pm
Forum: MicroPython
Topic: MicroPython double precision
Replies: 28
Views: 1700

Re: MicroPython double precision

<edit: oh, jahboater replied whilst I was typing away...> For the C language, speed is critical and yet double precision is the default (and it has always been so). As an amateur C programmer you might have to explain that to me. I thought one always got 32-bit single precision if one specified &quo...
by Paeryn
Mon Sep 13, 2021 8:35 pm
Forum: Python
Topic: indentation problem
Replies: 23
Views: 1509

Re: indentation problem

ok im able to call up the 3 sensors but can not get the code to loop. right now its a single shot input/output. #AirConditioner.py #import condensor, compressor, fan from tkinter import Tk from tkinter.ttk import * import os from w1thermsensor import W1ThermSensor os.system('modprobe w1-gpio') os.s...

Go to advanced search