Search Forums by tag:
Serial, mbed, compiler, ethernet, USB, I2C, SPI, interrupt, LCD, library, bug, HTTPServer, CAN, AnalogIn, adc, Power, Ticker, memory, pwm, SD Card, InterruptIn, rpc, Error, SDFileSystem, PwmOut, LocalFileSystem, UART, canbus, driver, TCP, interrupts, rtos, led, libraries, editor, timer, accelerometer, GPS, file, clock, website, C++, SD, frequency, reset, http, LPC11U24, flash, SDCard, RTC, DigitalIn, TCPSocket, problem, printf, Java, Servo, buffer, UDP, SerialPC, DMA, HTTPClient, Sleep, audio, pinball, MODSERIAL, NetServices, socket, array, compile, filesystem, RFID, beta, m3pi, write, LPC1768, multiple, newbie, keyboard, sensor, GPRS, Forum, digitalOut, assembly, debug, hardware, Speed, xbee, AnalogOut, RPCFunction, EthernetNetIf, Download, code, voltage, wait, network, C, suggestion, JTAG, keil, MATLAB, offline, Board, lwip, I2S, dead, Nokia6610, time, bluetooth, WiFly, current, tcp/ip, MODDMA, SPI Slave, pololu, robot, Communication, read, dac, string, pc, binary, filter, copy, USB Host, publish, rs232, DHCP, Host, Data Logging, windows, firmware, malloc, mp3, PCB, gcc, attach, program, fatfilesystem, class, email, arduino, stepper motor, WavePlayer, wifi, Nokia, camera, size, VGA, import, documentation, ide, linux, baud, TextLCD, Cortex-M0, M0, pointers, pullup, Relay, timing, function, latency, serial port, MIDI, compiler error codes, magjack, touch, screen, Production, client, server, stream, HID, breakout, FIFO, prototype, flashing, GPIO, sampling, Analog, display, api, ADXL345, Encoder, DSP, help, motor, sram, suggestions, PING, Terminal, link, browser, Pin, control, Eagle, Modbus, EEPROM, mac, Timeout, fopen, port, updates, usbserial, batteries, DMX, files, USBMIDI, scanf, protocol, PPP, slave, FTP, integer, noise, MODGPS, modem, float, threads, motors, for, monitor, Digital I/O, 7, Windows Serial Driver, pins, keypad, FAT, classes, webserver, delay, variables, time-triggered, c programming, labview, watchdog, post, math, Battery, LPCXpresso, MBED website, GSM, storage, nxp, mobileLCD, license, int, counter, baseboard, Assembler, Vin, rj45, registers, E289, news, i2cmaster, amoled, Compiling, connect, revision, prototype to hardware, UMTSStick, Optocoupler, Robotics, search, oscillator, glitch, Websockets, load, find, real-time, routine, format, offline compile, powersource, driverlibrary, processing, networking, ID, umts, debugging, color, BUTTON, software, PS3, Images, wave, bin, const, SNMP, OSX, supply, peripheral, sensors, data, Design, PID, version, RIT, character, freeze, USBDevice, bus, ARM, wav, SRF08, heap, output, basic, TFT, QVGA, mysql, piezo, update, ID12, Pachube, player, DigitalInOut, object, cmsis, capture, IR, slow, 1768, PSP, OS, syntax, mbed.lib, EmbeddedArtists, NMEA, paste, project, Web, GUI, UART0, firefox, SQL, wakeup, RAM, bitmap, handler, security, 3D, bugs, OLED, Temperature, not, I/O, Bidirectional, rss, wireless, delete, resolved, LED1, LIS302, getc, Safari, Wi-Fi, wiki, PinNames, accounts, PS2, BusOut, projects, RS485, pythonSerial has a function called 'writeable' which allows you to check if there is space to write a character before you call putc.
Tim Exton-McGuinness wrote:
I have ported my simple Round Robin Scheduler into mbed
Hi Tim
I'm interested in the theory of this, are there any code samples?
Thanks
Daniel
I have simplified and published the code now.
http://mbed.org/users/timexton/programs/round-robin-rtos/latest
Hi Tim,
I was trying to look at your scheduler but apparently there's no such page...
I also looked on your Profile page & that says that you haven't published any programs yet.
Is it possible for you to post/re-post this please? It sonds extremely useful.
Cheers,
JezC
I recently found that I was spending the majority of the time in my little app attempting to print to my serial LCD.
And so I wrote a buffered writer, it uses a ring buffer and the Serial TXIrq to that it ought not block.
I've written the code but not actually tested it yet, so I'm not ready to publish it.
I'm not actually 100% sure that it'll do for what I require now. I want the Data that's sent to be the most recent update rather that just to send it async in order, so I might create a double or possibly triple buffered serial writer that uses the TXIrq to flip between the buffers. I'll probably publish all the bits once I get them written :)
I found and ported a small RTOS called scmRTOS to mbed. Details here. It offers something called "channels" which might be what you need.
Please log in to post a reply.
No tags
|
I have ported my simple Round Robin Scheduler into mbed, being a cooperative scheduler the rule is 'dont wait but sleep()', to give the other tasks a slice of the cpu time (none stick code I call it).
Testing the timings out I see that doing a printf("Hello World") hangs that task thread by 15ms, a sprintf() followed by a series of putc(), followed by a sleep(), hang the thread by 1ms for each character. Understandably at 9600 baud 1 character takes about 1ms to transmit so I'm assuming that the Serial library code waits for transmitter empty, sort of understandable.
What I need is a sleepy putc(), has anyone any idea how to do this?