MCPcopy Create free account
hub / github.com/GValiente/butano / commit

Method commit

butano/src/bn_hdma_manager.cpp:92–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90 }
91
92 bool commit(bool use_dma, bool raise_irq)
93 {
94 const state& current_state = _current_state();
95
96 if(int elements = current_state.elements)
97 {
98 const uint16_t* source_ptr = current_state.source_ptr;
99 const uint16_t* initial_copy_source_ptr = source_ptr + ((display::height() - 1) * elements);
100 uint16_t* destination_ptr = current_state.destination_ptr;
101
102 if(use_dma)
103 {
104 hw::dma::copy_half_words(initial_copy_source_ptr, elements, destination_ptr);
105 }
106 else
107 {
108 hw::memory::copy_half_words(initial_copy_source_ptr, elements, destination_ptr);
109 }
110
111 if(raise_irq)
112 {
113 hw::dma::start_hdma_irq(_channel, source_ptr, elements, destination_ptr);
114 }
115 else
116 {
117 hw::dma::start_hdma(_channel, source_ptr, elements, destination_ptr);
118 }
119
120 return true;
121 }
122
123 hw::dma::stop_hdma(_channel);
124 return false;
125 }
126
127 private:
128 state _states[2];

Callers 1

commit_entriesFunction · 0.80

Calls 5

start_hdma_irqFunction · 0.85
start_hdmaFunction · 0.85
stop_hdmaFunction · 0.85
heightFunction · 0.50
copy_half_wordsFunction · 0.50

Tested by

no test coverage detected