Skip to content

Commit

Permalink
hotfix to display
Browse files Browse the repository at this point in the history
  • Loading branch information
sylefeb committed Dec 6, 2023
1 parent 89eccad commit ef6a0fe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions frameworks/verilator/SPIScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ void SPIScreen::cmd_write_ram()
// 6-6-6
m_rgb[(m_step - 1)] = m_byte;
if (m_step == 3) {
// fprintf(stdout,"666 x %d, y %d\n",m_x_cur,m_y_cur);
//fprintf(stdout,"666 x %d, y %d\n",m_x_cur,m_y_cur);
m_framebuffer.pixel<LibSL::Memory::Array::Wrap>(
m_y_cur,m_x_cur) = m_rgb;
}
Expand Down Expand Up @@ -235,8 +235,8 @@ void SPIScreen::cmd_write_ram()
// bgr
std::swap(m_rgb[0],m_rgb[2]);
}
//fprintf(stdout,"565 x %d, y %d rgb:%x,%x,%x\n",
// m_x_cur,m_y_cur,(int)m_rgb[0],(int)m_rgb[1],(int)m_rgb[2]);
fprintf(stdout,"565 x %d, y %d rgb:%x,%x,%x\n",
m_x_cur,m_y_cur,(int)m_rgb[0],(int)m_rgb[1],(int)m_rgb[2]);
m_rgb[0] <<= 3; m_rgb[1] <<= 2; m_rgb[2] <<= 3;
m_framebuffer.pixel<LibSL::Memory::Array::Wrap>(
m_y_cur,m_x_cur) = m_rgb;
Expand Down
8 changes: 4 additions & 4 deletions frameworks/verilator/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ void render()
// lock the mutex before accessing g_Chip
std::lock_guard<std::mutex> lock(g_Mutex);
// has the framebuffer changed?
if (g_Chip->framebufferChanged()) {
// yes: refresh frame
refresh();
}
//if (g_Chip->framebufferChanged()) {
// yes: refresh frame
refresh();
//}
}

// ----------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions learn-silice/classroom/soc_wave_player/firmware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ LD = $(ARCH)-ld
OBJS = sdcard.o div.o std.o config.o oled.o display.o printf.o mul.o crt0.o fat_io_lib.o

$(PRGS): %: %.o $(OBJS)
$(LD) -m elf32lriscv -b elf32-littleriscv --gc-sections -Tconfig_c.ld --no-relax -o code.elf $^
$(LD) -m elf32lriscv -b elf32-littleriscv -Tconfig_c.ld --no-relax -o code.elf $^
$(ARCH)-objcopy -O verilog code.elf code.hex
$(ARCH)-objdump --disassemble code.elf > code.s

%.o : %.c
$(CC) -ffunction-sections -fdata-sections -fno-builtin -fno-unroll-loops -O2 -fno-stack-protector -fno-pic -march=rv32i -mabi=ilp32 -c $< -o $@
$(CC) -fno-builtin -fno-unroll-loops -O2 -fno-stack-protector -fno-pic -march=rv32i -mabi=ilp32 -c $< -o $@

%.o : %.s
$(AS) -march=rv32i -mabi=ilp32 $< -o $@
Expand Down

0 comments on commit ef6a0fe

Please sign in to comment.