The shape of the action potential differs between the epicardium and the endocardium. The other leaflets are described as being plastered to the endocardium. The Purkinje cells are mostly found within both the endocardium and the sub-endocardium. Cardiac muscle lies in between the epicardium and the endocardium in the heart. The endocardium, which is primarily made up of endothelial cells, controls myocardial function. The endocardium is the last layer to repolarize. The intrinsicoid deflection reflects the depolarization vector from the endocardium to the epicardium. It is located in the endocardium of the atrial surface of the right atrioventricular valve. The wall of the heart is made up of three layers&colon; epicardium, myocardium, and endocardium. The "openings of smallest cardiac veins" are located in the endocardium. The innermost layer of the heart is called the endocardium. The heart valves and the chambers are lined with endocardium. Damaged valves and endocardium contribute to the development of infective endocarditis. The endocardium also provides protection to the valves and heart chambers. The endocardium is the innermost layer of tissue that lines the chambers of the heart.