int fn_putc ( int ch, F_FILE * filehandle ) { unsigned char tmpch = (unsigned char)ch; if ( fn_write( &tmpch, 1, 1, filehandle ) ) { return ch; } else { return -1; } }
/* ** fr_write ** ** INPUT : bbuf - buffer to write from ** size - number of unique ** size_st - size of unique ** *filehandle - pointer to the file descriptor ** RETURN: number of written bytes */ long fr_write ( const void * bbuf, long size, long size_st, F_FILE * filehandle ) { long rc; if( xSemaphoreTake( fs_lock_semaphore, F_MAX_LOCK_WAIT_TICKS ) == pdPASS ) { rc = fn_write( bbuf, size, size_st, filehandle ); xSemaphoreGive( fs_lock_semaphore ); } else { rc = 0; } return rc; }