Replies: 5 comments 9 replies
-
Yes, CScreenDevice::InvertCursor() is the right method for that purpose. It
is called, when the cursor is set and again, when it is removed.
CCharGenerator::GetUnderline() returns the line number, where the underline
cursor starts. I think, a block cursor should be drawn from line m_nCursorX to
m_nCursorX + CCharGenerator::GetUnderline() - 1. If you want to implement a
block cursor as an option (e.g. SCREEN_BLOCK_CURSOR) and send a PR, please do.
|
Beta Was this translation helpful? Give feedback.
-
Aren't the "lines" on the y axis? I thought m_nCursorX specifies a location along the width. |
Beta Was this translation helpful? Give feedback.
-
No problem - thank you for your guidance. I have been doing some prototyping with a modified version of CScreenDevice::InvertCursor(). When I modify anything in that routine, I get the following error message at startup on a Pi4:
I am using the 08 sample to try this out and the ONLY mods I have attempted are in the screen.cpp file and I don't get any warnings or errors from GCC when running makeall. Any idea why -ANY- modification of InvertCursor() would blow up like this? |
Beta Was this translation helpful? Give feedback.
-
Yes - got it to work, although I am not sure if it meets your standards. While I am able to get it working, I run my systems on a KVM and if I change to a different machine using the KVM and then back, the system halts with: Transfer error 36 on endpoint 3 followed by "Trying to allocate more than 0 instances." All work has been committed to a fork here: https://github.com/jnorrid/circle. The vast majority of the changes are to screen.h, screen.cpp, and sample 08. I am using makeall in the repo root to build changes to the library, then using make and then make flash to send the sample08 code updates to the serial bootloader. I have not yet issued PR as I am not confident that I have done this correctly but I am stuck as to why it is failing after KVM position change and revert. |
Beta Was this translation helpful? Give feedback.
-
OK - I performed a fresh git clone and changed to the develop branch locally to pick up the commit. I then added my custom Config.mk and Rules.mk modification to point to my local toolchain and to setup use of the serial bootloader. I uncommented line 101 in the kernel.cpp file from sample-08-usbkeyboard. I then performed makeall in local repo root followed by make, and make flash to push the code to one of my Pi4 machines hooked to the KVM. Everything works fine now when switching KVM positions between different machines and back to the Pi, so it appears that the issue I was encountering did, in fact, have to do with the memory allocation problem you mentioned you had fixed in develop. Looks like the change is good to go now. |
Beta Was this translation helpful? Give feedback.
-
How might one go about adding an option for a BLOCK cursor instead of the default underscore cursor for use with text on the screen? I have been looking at line 1000 of /lib/screen.cpp and wondering if I should just change this method or if there is a simpler option elsewhere in the framework. Also found several references to GetUnderline in CharGenerator, but I don't think that is where the cursor is defined. Happy to fork and issue a PR if it just needs to be implemented...
Beta Was this translation helpful? Give feedback.
All reactions